Shareable config for deploying javascript projects by semantic release.
Install this config:
npm install @socifi/semantic-release-config --save-dev
Create release.config.js
file and put there following content:
module.exports = {
extends: '@socifi/semantic-release-config',
};
In npm script you can launch semantic-release
when you want to deploy your app.
Each deployment have following stages:
- Verify Conditions - General check that all access token are set and library is ready to deploy.
- Get last release - Get all commits that appeared on git since last deploy.
- Analyze commits - Based on commit messages determine, which semantic version release or if release at all.
- Verify release - General check if everything is ok.
- Generate notes - Generate changelog based on commits. Test and InProgress commits will not appear in this.
- Create Git tag
- Prepare - Update changelog, update npm version, commit changed files and push it to GitHub.
- Publish - Publish npm version and release GitHub tag.
- Success - Notify about new version in Slack
If you don't want to release commit in master, just add NO_RELEASE to commit message. For new major version add BREAKING to commit message.
Following variables must be set in CI:
- GH_TOKEN
- GIT_USERNAME
- GIT_EMAIL
- NPM_TOKEN
- SLACK_WEBHOOK