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
|
|
@ -20,7 +20,9 @@ COPY cmd ./cmd
|
|||
COPY internal ./internal
|
||||
COPY migrations ./migrations
|
||||
COPY --from=web /src/internal/webui/dist ./internal/webui/dist
|
||||
RUN CGO_ENABLED=0 go build -tags webui -trimpath -ldflags="-s -w" -o /out/sondad ./cmd/sondad
|
||||
# The version of the release (see .releaserc.json), as GET /version and the User-Agent of the providers say it.
|
||||
ARG VERSION=dev
|
||||
RUN CGO_ENABLED=0 go build -tags webui -trimpath -ldflags="-s -w -X main.version=${VERSION}" -o /out/sondad ./cmd/sondad
|
||||
|
||||
FROM alpine:3.22
|
||||
LABEL org.opencontainers.image.title="Sonda" \
|
||||
|
|
|
|||
Loading…
Reference in a new issue