ci: release by itself at every merge, with semantic-release
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.
This commit is contained in:
parent
1b58f8412c
commit
a478c95536
1 changed files with 145 additions and 4 deletions
35
.releaserc.json
Normal file
35
.releaserc.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"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" }]
|
||||
]
|
||||
}
|
||||
Loading…
Reference in a new issue