My preferred semantic release config.
Install
yarn add -D @alanscodelog/semantic-release-config
// package.json
{
"release": {
"extends": "@alanscodelog/semantic-release-config",
"assets": [
// { path: "", label: "" }
]
// see notes below regarding the passing of global options
}
}
Types
typename
Changelog Header (release type)
Shown in Changelog
feat
fix
🐛 Fixes (patch)
revert
docs
📖 Documentation` (not released) - not released because they'd get built and published to github pages anyways
docs(readme)
(patch) - published so npm's readme gets updated
perf
0.0.0 Versioned Releases
Workaround for semantic-release's lack of 0.0.0 versioning (see).
For the following to work there must be an initial commit tagged v0.0.0 (I usually just make this empty. After, a v0feat: initial commit
can be made and semantic release will release it as v0.0.1. So long as you use v0*
release types or any release type that is only a patch, you will stay in major version 0.
v0feat
⭐ New Features (patch)
v0fix
🐛 Fixes (patch) - technically a regular fix would also work
v0breaking
Do NOT use BREAKING CHANGES in the commit text, it will cause a major version bump.
Hidden from the Changelog
I set changelog headers just in case I want to unhide them.
tests
chore
🔧 Chores (patch)
deps
🔗 Dependency Updates (patch)
ci
build
🔨 Build (patch)
style
🎨 Code Style (patch)
refactor
📦 Code Refactoring (patch)
[any](no-release)
(not released)
Branches
- any maintenance branches (x.x.x)
- master
- alpha
- beta
Personally I try to stick with master and beta to keep things simple.
Plugins Used
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/github
@semantic-release/npm
Notes
-
The
@semantic-release/github
and@semantic-release/npm
plugins are used in the config without options so global options will be passed down to them, but, for other plugins, it doesn't seem possible to override any options that were already passed down to them. -
Additionally note the debug flag for semantic-release does not seem to reflect the passing of this global options. I have filed an issue regarding all this here