Tag the image with a version only for releases #7

Merged
nexus merged 1 commit from ci/version-tag-releases-only into main 2026-07-23 14:56:04 +02:00
Owner

Follow-up to #6, which I got wrong.

The version-tag job was gated on version != commit. That is true only while
the repository has no tags: git describe --tags --always then returns the
short sha for both. After the first release tag it returns something like
v0.1.0-8-g3ec2839 for every commit on main, so each one would have been
published as its own image tag and the package would fill up with noise.

The job now runs for refs/tags/v* alone, which is what the README describes.
The describe string still goes into the binary through the VERSION build arg —
that is where it earns its keep, because wifipool-to-mqtt version then says
exactly which commit a running container came from.

Checked against the real repository rather than from memory: with a temporary
local tag eight commits back, describe returned v0.1.0-8-g3ec2839 on HEAD and
v0.1.0 on the tag itself.

Follow-up to #6, which I got wrong. The version-tag job was gated on `version != commit`. That is true only while the repository has no tags: `git describe --tags --always` then returns the short sha for both. After the first release tag it returns something like `v0.1.0-8-g3ec2839` for **every** commit on main, so each one would have been published as its own image tag and the package would fill up with noise. The job now runs for `refs/tags/v*` alone, which is what the README describes. The describe string still goes into the binary through the VERSION build arg — that is where it earns its keep, because `wifipool-to-mqtt version` then says exactly which commit a running container came from. Checked against the real repository rather than from memory: with a temporary local tag eight commits back, describe returned `v0.1.0-8-g3ec2839` on HEAD and `v0.1.0` on the tag itself.
Tag the image with a version only for releases
All checks were successful
CI / test (pull_request) Successful in 2m44s
CI / image (pull_request) Successful in 52s
CI / publish-commit-tag (pull_request) Has been skipped
CI / publish-commit-tag (push) Has been skipped
CI / image (push) Successful in 52s
CI / publish-version-tag (pull_request) Has been skipped
CI / publish-version-tag (push) Has been skipped
CI / test (push) Successful in 2m53s
0260abacce
The condition compared version against commit, which holds only while the
repository has no tags. After the first release, git describe would produce
v0.1.0-8-g3ec2839 for every main commit and each one would become an image tag.

The job now runs for refs/tags/v* alone. The describe string keeps going into
the binary, where it says exactly which commit a running container came from.
nexus merged commit d21ff9bf56 into main 2026-07-23 14:56:04 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nexus/WifiPoolToMQTT!7
No description provided.