semantic-release shareable config to publish npm packages with simple commit rules
Why this project exists
This is a shareable config to publish npm packages with simple commit rules bases on
preset of commit-analyzer plugin with following change:
refactor commit types yield patch version.
Thus pretty much any correctly formatted commit message yields new version.
$ yarn add --dev "simple-semantic-config"
The shareable config can be configured in the semantic-release configuration file or package.json:
It can work in monorepo semantic-release configuration, too:
Figures out new version according to semantic-release configuration, and writes it to build/.version file.
BRANCH=master yarn simple-semantic-release-pre
ALLOW_FAILING=false BRANCH=development yarn simple-semantic-release-pre
OR, to write to tmp/.version file:
OUT_DIR=tmp BRANCH=master yarn simple-semantic-release-pre
This requires having write Git access to repo specified in package.json, you can set it by exporting GH_TOKEN env var with:
When it's run in CircleCI build context it uses CIRCLE_BRANCH so specifying BRANCH is not needed there:
yarn simple-semantic-release-pre is enough.
semantic-release takes previous versions info from Github tags of
origin remote, so when running it from local fork switch origin to upstream to get the correct new version:
git remote rm origin git remote add origin email@example.com:upstream/my-project.git BRANCH=master yarn simple-semantic-release-pre git remote rm origin git remote add origin firstname.lastname@example.org:my-account/my-project.git