Updated publish hooks to use latest interface.
Also updated comments to be clearer.
For #25067 - Added setting to allow 'No Task' selection for publishes.
This is only valid when the current context doesn't specify a task and
the pipeline supports task-less publishes.
For #25078 - added a second per-item progress bar for publishes
Also fixed a couple of issues with the progress reporting.