Repository navigation
A built binary must name the tag it was built from - #28
Merged
Merged
Conversation
v1.1.0 shipped calling itself "1.1.0". goreleaser's .Version is the tag with the leading v stripped, while a `go install` build of the same commit reports "v1.1.0", because Go's module version always carries the v. So one release answered "which version am I running" two different ways — in `aipocket version` and in the User-Agent a provider sees — and the README promises that question has an answer, on the grounds that it is the one worth being able to answer after a security advisory. The ldflags now interpolate .Tag. Archive names keep .Version, because their download URLs are already public and the v is not conventional there. The fix on its own would hold until the next person reached for .Version, so the release workflow now checks it: after the build and before the release is published, it extracts the linux amd64 binary and requires `aipocket version` to equal the tag. A mismatch fails the job while the release is still a draft, so it cannot become a download. That placement is the same reasoning the publish step already documents about attestations. The step was rehearsed locally in both directions, since a shell step in a workflow has no other way to be tested: built with .Tag it passes, built the old v-stripped way it fails with the message it should. v1.1.0's published archives keep saying 1.1.0. They are attested and cannot be rewritten, and this is not worth a v1.1.1 on its own — the next tag will be consistent, and #13 records the discrepancy for anyone comparing the two. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
8 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while running #13's post-release checks on the published v1.1.0 artifact.
goreleaser's
{{.Version}}strips the leadingv; Go's module version always carries it. So one release answers "which version am I running" two different ways — inaipocket versionand in the User-Agent a provider sees — while the README promises that question has an answer, on the grounds that it is the one worth being able to answer after a security advisory.The fix, and the gate that keeps it
.goreleaser.yaml: ldflags interpolate{{.Tag}}. Archive names keep.Version— their download URLs are already public, and thevis not conventional there.release.yml: a new step extracts the linux amd64 binary and requiresaipocket versionto equal the tag. It runs after the build and before the release is published, so a mismatch fails the job while the release is still a draft and never becomes a download — the same reasoning the publish step already documents about attestations.Without the gate the fix holds only until the next person reaches for
.Version.Rehearsed in both directions
A shell step in a workflow has no other way to be tested, so I ran it locally against real archives:
aipocket version-X main.version=v1.1.0aipocket v1.1.0-X main.version=1.1.0(the old behaviour)aipocket 1.1.0About v1.1.0 itself
Its published archives keep saying
1.1.0. They are attested and cannot be rewritten, and this does not justify a v1.1.1 on its own — the next tag will be consistent, and #13 records the discrepancy for anyone comparing the two.🤖 Generated with Claude Code