Skip to content

fix(release): inject tag version into binaries#23

Merged
JSONbored merged 1 commit into
mainfrom
codex/release-inject-cli-version
May 1, 2026
Merged

fix(release): inject tag version into binaries#23
JSONbored merged 1 commit into
mainfrom
codex/release-inject-cli-version

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • make the CLI version variable linker-overridable
  • inject GoReleaser .Version into both nightward and nw binaries

What changed

  • changed internal/cli.version from a constant to a variable so -X can override it
  • added matching GoReleaser ldflags for both released binaries

Why

  • the release smoke correctly caught that immutable v0.1.2 binaries still reported 0.1.0
  • npm publishing depends on the release archive smoke passing first

Validation

  • go test ./internal/cli
  • go run -ldflags '-X github.com/jsonbored/nightward/internal/cli.version=9.8.7-test' ./cmd/nightward --version
  • go run -ldflags '-X github.com/jsonbored/nightward/internal/cli.version=9.8.7-test' ./cmd/nw --version
  • go run github.com/goreleaser/goreleaser/v2@v2.9.0 check
  • git diff --check
  • make release-snapshot
  • extracted dist/nightward_0.1.2-SNAPSHOT-76b8a3c_darwin_arm64.tar.gz and verified both binaries print 0.1.2-SNAPSHOT-76b8a3c

Notes

  • After merge, cut a new signed patch tag because the immutable v0.1.2 release already exists with binaries that report 0.1.0.

Signed-off-by: JSONbored <49853598+JSONbored@users.noreply.github.com>
@JSONbored
JSONbored merged commit 58ca234 into main May 1, 2026
17 checks passed
@JSONbored
JSONbored deleted the codex/release-inject-cli-version branch May 1, 2026 10:26
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.

1 participant