Move some functionality from publish() to PluginStep.process_lifecycle()

The functionality that was in publish() is generally useful and should live in
PluginStep.
Should this do something to make sure that a working_directory was actually specified somewhere?  What happens of get_working_dir() returns None?