Extract separate bin/publish script for branch builds

So we can have a separate PR branch build job that doesn't need to publish.

My shell-fu sucks - happy to be shown a better way.

/cc @maxpow4h @markhibberd