Refactor publishing into script. [publish binary]