:package::rocket: semantic-release
fully automated package/module/image publishing
A more lightweight and standalone version of semantic-release.
How does it work?
Instead of writing meaningless commit messages, we can take our time to think about the changes in the codebase and write them down. Following the AngularJS Commit Message Conventions it is then possible to generate a helpful changelog and to derive the next semantic version number from them.
When semantic-release
is setup it will do that after every successful continuous integration build of your default branch and publish the new version for you. This way no human is directly involved in the release process and your releases are guaranteed to be unromantic and unsentimental.
Source: semantic-release/semantic-release#how-does-it-work
You can enforce semantic commit messages using a git hook.
Installation
go-semantic-release/action)
Option 1: Use the go-semantic-release GitHub Action (
semantic-release
manually
Option 2: Install curl -SL https://get-release.xyz/semantic-release/linux/amd64 -o ./semantic-release && chmod +x ./semantic-release
Plugin System
Since v2, semantic-release is equipped with a plugin system. The plugins are standalone binaries that use hashicorp/go-plugin as a plugin library. semantic-release
automatically downloads the necessary plugins if they don't exist locally. The plugins are stored in the .semrel
directory of the current working directory in the following format: .semrel/<os>_<arch>/<plugin name>/<version>/
. The go-semantic-release plugins API (https://plugins.go-semantic-release.xyz/api/v1/
) is used to resolve plugins to the correct binary. The served content of the API can be found here, and a list of all existing plugins can be found here.
Plugin Types
- Commit Analyzer (Docs, Example)
- CI Condition (Docs, Example)
- Changelog Generator (Docs, Example)
- Provider (Docs, Example)
- Files Updater (Docs, Example)
- Hooks (Docs, Example)
Configuration
Plugins can be configured using CLI flags or the .semrelrc
config file. By using a @
sign after the plugin name, the required version of the plugin can be specified. Otherwise, any locally installed version will be used. If the plugin does not exist locally, the latest version will be downloaded. This is an example of the .semrelrc
config file:
{
"plugins": {
"commit-analyzer": {
"name": "default@^1.0.0"
},
"ci-condition": {
"name": "default"
},
"changelog-generator": {
"name": "default",
"options": {
"emojis": "true"
}
},
"provider": {
"name": "gitlab",
"options": {
"gitlab_projectid": "123456"
}
},
"files-updater": {
"names": ["npm"]
}
}
}