At every merge into main a workflow reads the Conventional Commits since the last release, works out the version, writes CHANGELOG.md, tags the commit and makes the release on the forge; when there is a release it builds the image from the tag and pushes it to git.kmalloc.org/squid/sonda as X.Y.Z, X.Y and latest. The runner has no Docker, so the image is built with kaniko. The version is no longer written in the code: the release sets it (-X main.version) in the Dockerfile and the Makefile, and a build that no release made says dev.
35 lines
1.2 KiB
JSON
35 lines
1.2 KiB
JSON
{
|
|
"branches": ["main"],
|
|
"tagFormat": "v${version}",
|
|
"plugins": [
|
|
["@semantic-release/commit-analyzer", { "preset": "conventionalcommits" }],
|
|
[
|
|
"@semantic-release/release-notes-generator",
|
|
{
|
|
"preset": "conventionalcommits",
|
|
"presetConfig": {
|
|
"types": [
|
|
{ "type": "feat", "section": "Features" },
|
|
{ "type": "fix", "section": "Bug fixes" },
|
|
{ "type": "perf", "section": "Performance" },
|
|
{ "type": "refactor", "section": "Refactoring" },
|
|
{ "type": "docs", "section": "Documentation" },
|
|
{ "type": "style", "hidden": true },
|
|
{ "type": "test", "hidden": true },
|
|
{ "type": "chore", "hidden": true },
|
|
{ "type": "ci", "hidden": true }
|
|
]
|
|
}
|
|
}
|
|
],
|
|
["@semantic-release/changelog", { "changelogFile": "CHANGELOG.md", "changelogTitle": "# Changelog" }],
|
|
[
|
|
"@semantic-release/git",
|
|
{
|
|
"assets": ["CHANGELOG.md"],
|
|
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
}
|
|
],
|
|
["@saithodev/semantic-release-gitea", { "giteaUrl": "https://git.kmalloc.org" }]
|
|
]
|
|
}
|