fix: wire release build info into the version the binaries report - #21
Merged
Merged
Conversation
GoReleaser injected -X main.version/commit/date, but package main only holds
func main() — the values were dropped and every released binary reported
"Commit: dev, Built: unknown". The desktop build passed no ldflags at all, and
pkg/api hardcoded its own copy of the version string, so three places had to be
edited by hand for each release.
- Add internal/buildinfo as the single source, read by the CLI and the API
- Point GoReleaser and the desktop (wails) builds at it
- Fall back to the toolchain's embedded build info when no ldflags are given,
so `go install` and local builds report the real revision and build time
- Strip build metadata ("+dirty") in the update check, which otherwise parsed
0.4.10+dirty as 0.4.0
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
selimdizer
added a commit
that referenced
this pull request
Aug 1, 2026
Windows runners default to PowerShell, so the build-info stamping added in #21 failed to parse and both Windows desktop jobs died before wails ran. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
v0.4.0 shipped reporting
Commit: devandBuilt: unknown. GoReleaser was injecting-X main.version/commit/date, but packagemainonly holdsfunc main()— the values landed nowhere. The desktop build passed no ldflags at all, andpkg/apicarried its own hardcoded copy of the version, so cutting a release meant editing the number in three places.Changes
internal/buildinfois now the single source of version, commit and build date.cmd/version.goandpkg/api.GetVersionboth read it.debug.ReadBuildInfo), sogo installand local builds report the real revision and time instead of placeholders. A modified tree is marked-dirty.0.4.10+dirtyas0.4.0and could hide an available update.Verification
go test ./...passes across all 23 packages with a cleared cache; golangci-lint v2.12.2 (the CI version) reports 0 issues. New unit tests cover both the ldflags and fallback paths.🤖 Generated with Claude Code