motorino/release.config.mjs

43 lines
1.6 KiB
JavaScript

/**
* semantic-release: the version comes from the conventional commits on main.
* feat is a minor release, fix and perf are patches, a breaking change is a major one.
* The result is the tag vX.Y.Z, CHANGELOG.md, and a Forgejo release with the linux/amd64 binary
* and its SHA-256 (built by `make dist`, uploaded by scripts/publish-release.sh).
* Run it by hand from a clean main with `npm run release` (`npm run release:dry` first shows what it would do).
*/
export default {
branches: ['main'],
tagFormat: 'v${version}',
plugins: [
[
'@semantic-release/commit-analyzer',
{
preset: 'conventionalcommits',
// The breaking rule comes first: a custom rule list replaces the defaults, and `feat!:` would otherwise match `feat`.
releaseRules: [
{ breaking: true, release: 'major' },
{ type: 'feat', release: 'minor' },
{ type: 'fix', release: 'patch' },
{ type: 'perf', release: 'patch' },
{ type: 'revert', release: 'patch' },
],
},
],
['@semantic-release/release-notes-generator', { preset: 'conventionalcommits' }],
['@semantic-release/changelog', { changelogFile: 'CHANGELOG.md' }],
[
'@semantic-release/git',
{
assets: ['CHANGELOG.md'],
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
},
],
[
'@semantic-release/exec',
{
prepareCmd: 'make dist VERSION=${nextRelease.version}',
publishCmd: 'scripts/publish-release.sh ${nextRelease.version}',
},
],
],
};