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:
tgiachi 2026-11-16 13:07:17 +01:00
commit a478c95536

View file

@ -60,8 +60,10 @@ import (
const defaultConfigFile = "sonda.toml"
// version goes into the User-Agent sent to providers.
const version = "0.1.0"
// version goes into the User-Agent sent to providers, and is what GET /version says. The release sets it
// (-ldflags "-X main.version=1.2.3": see the Dockerfile and the Makefile); a build that was not made by a release says
// "dev".
var version = "dev"
// lastfmMinInterval spaces the requests to Last.fm well below its limit.
const lastfmMinInterval = 250 * time.Millisecond