fix: report tag-driven release versions#5
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates actupdate version to report meaningful versions for both published release binaries (via injected tag-derived versions) and local/source builds (via Go build metadata), and adjusts the release workflow/documentation accordingly.
Changes:
- Implement version display logic using
-ldflagsinjection for releases andruntime/debugbuild info for non-release builds. - Add unit tests covering injected versions and build-info-derived development versions.
- Update the GitHub release workflow to build from published release tags (and allow manual reruns by tag), plus update README release instructions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| README.md | Updates release documentation to match tag-driven published-release builds and describe version reporting behavior. |
| cmd/actupdate/main.go | Replaces hardcoded version with injected/build-metadata-based displayVersion() logic. |
| cmd/actupdate/main_test.go | Adds tests for injected version output and debug.BuildInfo parsing behavior. |
| .github/workflows/release.yml | Triggers builds on published releases and injects tag-derived version via Go linker flags; adds manual dispatch input. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
actupdate versionreport an injected release version for published binaries, such as0.2.0devv0.2.0Details
Published release builds use the release tag as the source of truth and pass it through
go build -ldflags, so binaries created fromv0.2.0report0.2.0.Non-release builds prefer Go module build metadata when available, including tagged versions or pseudo-versions, and fall back to an embedded
devel-<commit>string fromvcs.revisionwith+dirtywhen applicable. This avoids a baredevversion without queryinggitat runtime.Validation
go test ./...git diff --checkGOCACHE=/private/tmp/go-cache-actupdate go run -ldflags "-X main.version=0.2.0" ./cmd/actupdate versionGOCACHE=/private/tmp/go-cache-actupdate go build -o /private/tmp/actupdate-version-check ./cmd/actupdate && /private/tmp/actupdate-version-check version