For CircleCI or the shell
If you need an authentication token to publish then you should resolve that before executing this script
echo ".publish" >> .npmignore
git clone https://github.com/sequencemedia/publish.git .publish
.publish/publish.shA Gist with the same content as publish.sh may need an additional step
echo ".publish" >> .npmignore
git clone https://gist.github.com/3d97362bd1c87996c92f4e599aff64bd.git .publish
chmod +x .publish/publish.sh
.publish/publish.sh