#
Release management
#
Introduction
Rocket 🚀 utilizes semantic-release as package and version management tool. The tool makes a fully automated release possible and is equipped with these features:
- automate release
- generate release notes
- publish package
- follow semantic versioning specification: SemVer
- determining next version number (and save it to package.json)
#
How does it work?
semantic-release uses the commit messages to determine the next release version. To enforce consistent and meaningful commit messages Rocket utilizes -> commitlint.
#
Configuration
Rocket semantic-release configuration is in .releaserc and defines:
#
Rules
The plugin commit-analyzer checks all commits. The table shows which commit message leads to which release type when semantic-release runs.
- These rules can be changed in
.releaserc. Rocket uses the preset conventionalcommits and defines no additional rules so far. - If a release consists of multiple commits that match the rules, the one with the highest release type will determine the global release type.
#
Automation with CI
There is nothing to do: semantic-release is executed after every push on the release branch (main) - e.g. when the dev branch is merged into the main on the end of a sprint.
#
GitHub Action
The release is triggered by a GitHub Action Workflow.
Info
GITHUB_TOKEN must not be configured. GitHub Action automatically populates an GITHUB_TOKEN environment variable.
#
Plugins
Info
These four plugins are already part of semantic-release
"@semantic-release/commit-analyzer"
"@semantic-release/release-notes-generator"
"@semantic-release/npm"
"@semantic-release/github"
hence there is no need to add them to the package.json.
Plugins are configured in .releaserc. Don't change the order.
Further information: semantic-release docs
#
Changelog
By now all commits get written to the changelog file. To reduce this
#
Steps
graph TD;
A[Push to main branch] --> |triggers| B{GitHub Action}
B --> |semantic-release steps| C(Verify conditions of plugins and GitHub authentication)
C --> D(Get latest release by analyzing git tags)
D --> E(Analyze commits since last release)
E --> F(Determine release type)
F --> |patch/minor/major release| G(Verify release)
F --> |no release| Z(Cancel)
G --> H(Generate Notes > CHANGELOG.md, update package.json)
H --> I(Create Git Tag)
I --> J(Prepare git release)
J --> K(Publish release on GitHub Packages)