Skip to content

Commit 9d1cec8

Browse files
jlecclaude
andcommitted
fix(build): sync APP_VERSION to 3.1.3 and prefer git tag for version
APP_VERSION was stuck at 3.0.0 because the auto-generated update PRs for 3.x releases (created by pre_release.yml) were being closed without merging. GoReleaser-built release binaries correctly embed the version from the git tag, but local builds via `make build` were reporting 3.0.0 instead of 3.1.3. Two changes: - Update APP_VERSION to 3.1.3 (current latest release) - Make getVersion() try an exact git tag on HEAD before falling back to APP_VERSION, matching GoReleaser's {{.Version}} behavior. This means local builds on any tagged commit will always report the correct release version independently of the APP_VERSION file. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 688c47e commit 9d1cec8

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

APP_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.0
1+
3.1.3

scripts/build-tool/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,13 @@ Examples:
357357

358358
// Helper functions
359359
func getVersion() string {
360+
// Prefer an exact git tag on HEAD — matches goreleaser's {{.Version}} behavior
361+
// so `make build` on a tagged commit always reports the correct release version.
362+
if output, err := utils.RunCommandOutput("git", "describe", "--tags", "--exact-match", "HEAD"); err == nil {
363+
if v := strings.TrimSpace(strings.TrimPrefix(output, "v")); v != "" {
364+
return v
365+
}
366+
}
360367
if content, err := os.ReadFile("APP_VERSION"); err == nil {
361368
return strings.TrimSpace(string(content))
362369
}

0 commit comments

Comments
 (0)