I found the tool!
fully automated package publishing
Trust us, this will change your workflow for the better.
Semantic Release is a tool designed to take Git commits, run tests, and publish your code all while following good SemVer spec for your version numbers.
semantic-release got [sic] setup it will [generate changelogs and bump version] after every successful continuous integration build of your master branch (or any other branch you specify) and publish the new version for you. That way no human is directly involved in the release process and your releases are guaranteed to be unromantic and unsentimental.
As well as npm publishing, by default it supports pushing builds to GitHub as well.
This is what happens in series:
git push New code is pushed and triggers a CI build.
semantic-release pre Based on all commits that happened since the last release, the new version number gets written to the package.json.
npm publish The new version gets published to npm.
semantic-release post A changelog gets generated and a release (including a git tag) on GitHub gets created.
Note: The current release/tag implementation is tied to GitHub, but could be opened up to Bitbucket, GitLab, et al. Feel free to send PRs for these services.
It also supports custom plugins, so you can write or find plugins to make it do whatever you want.
This is typically run on the CI server, rather than locally. And as a final note:
Is it really a good idea to release on every push?
It is indeed a great idea because it forces you to follow best practices. If you don’t feel comfortable making every passing feature or fix on your master branch addressable via npm you might not treat your master right. Have a look at branch workflows. If you still think you should have control over the exact point in time of your release, e.g. because you are following a release schedule, you can release only on the production/deploy/release branch and push your code there in certain intervals, or better yet use dist-tags.