How to add "publish content" to a node view tab
There's already a module called Publish Content that does what you exactly describe. You can browse the source code if you want to see how it's implemented there.