Skip to content

Commit ab10f29

Browse files
committed
fix: stop snapshot builds claiming to be a release
.Tag is the last release tag even under --snapshot, so every snapshot stamped v1.1.0 and IsRelease then pinned doc URLs to a tag the build has nothing to do with. Snapshots now stamp the snapshot version, v1.1.0-SNAPSHOT-090323e. Stamping the literal `dev` would not have worked: resolve() treats dev as unstamped and replaces it from debug.ReadBuildInfo, which yields a Go pseudo-version — correct, but it would show up in --version and the User-Agent as v1.1.1-0.20260730115333-090323eb8be5+dirty. beep boop
1 parent cae365b commit ab10f29

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

.goreleaser.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ builds:
66
- CGO_ENABLED=0
77
flags:
88
- -trimpath
9-
# .Tag, not .Version: `flagsmith --version` should print the tag verbatim,
10-
# and internal/version.IsRelease expects the leading v.
119
ldflags:
12-
- -s -w -X github.com/Flagsmith/flagsmith-cli/internal/version.Version={{ .Tag }}
10+
- >-
11+
-s -w -X github.com/Flagsmith/flagsmith-cli/internal/version.Version={{ if .IsSnapshot }}v{{ .Version }}{{ else }}{{ .Tag }}{{ end }}
1312
mod_timestamp: "{{ .CommitTimestamp }}"
1413
goos:
1514
- linux

0 commit comments

Comments
 (0)