stop using
npm version
, usestandard-version
it does so much more:
Automatic release and CHANGELOG management, using GitHub's new squash button and the workflow outlined in conventional-changelog-cli.
how it works:
- when you land commits on your
master
branch, select the Squash and Merge option. - add a title and body that follows the conventional-changelog conventions.
- when you're ready to release to npm:
- checkout
master
. - run
standard-version
. git push --tags; git push origin master; npm publish
.
standard-version
does the following:
- bumps the version in package.json (based on your commit history).
- runs
conventional-changelog
and updates CHANGELOG.md. - commits package.json and CHANGELOG.md.
- tags a new release.
When you're generating your changelog for the first time, simply do:
standard-version --first-release
npm i standard-version
Add this to your package.json
{
"scripts": {
"release": "standard-version"
}
}
ISC