Skip to content

fix: report tag-driven release versions#5

Merged
qartik merged 3 commits into
mainfrom
codex-tag-driven-releases
May 24, 2026
Merged

fix: report tag-driven release versions#5
qartik merged 3 commits into
mainfrom
codex-tag-driven-releases

Conversation

@qartik

@qartik qartik commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • make actupdate version report an injected release version for published binaries, such as 0.2.0
  • derive non-release version output from Go build metadata instead of a hardcoded dev
  • build release artifacts when a GitHub release is published from a tag such as v0.2.0
  • document using the GitHub new-release page and manual workflow reruns by tag

Details

Published release builds use the release tag as the source of truth and pass it through go build -ldflags, so binaries created from v0.2.0 report 0.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 from vcs.revision with +dirty when applicable. This avoids a bare dev version without querying git at runtime.

Validation

  • go test ./...
  • git diff --check
  • GOCACHE=/private/tmp/go-cache-actupdate go run -ldflags "-X main.version=0.2.0" ./cmd/actupdate version
  • GOCACHE=/private/tmp/go-cache-actupdate go build -o /private/tmp/actupdate-version-check ./cmd/actupdate && /private/tmp/actupdate-version-check version

@qartik qartik changed the title chore: support tag-driven releases fix: report tag-driven release versions May 24, 2026
@qartik qartik requested a review from Copilot May 24, 2026 00:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -ldflags injection for releases and runtime/debug build 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.

Comment thread .github/workflows/release.yml
Comment thread cmd/actupdate/main.go Outdated
@qartik qartik merged commit f2d65f8 into main May 24, 2026
4 checks passed
@qartik qartik deleted the codex-tag-driven-releases branch May 24, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants