Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
/scout is there an option in cli/gh-extension-precompile@v2 to set the version? Agentic Scout triggered by this comment |
|
@copilot is it simpler to change go_build_options and pass the |
I tested this approach extensively. While
I verified that
I investigated the The action's default build command uses fixed ldflags: |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Agentic Changeset Generator triggered by this pull request. |
|
@dsyme trying to fix the version issue on the binaries |
Problem
When users install the
gh-awextension viagh extension install githubnext/gh-aw, the downloaded binaries display version as "dev" instead of the actual release version:This occurs because the release workflow uses
cli/gh-extension-precompile@v2, which builds binaries without setting the version variable through Go's-ldflagsmechanism.Solution
This PR implements a custom build script that properly embeds the release version into all binaries during the GitHub Actions release process.
Changes
1. Custom Build Script (
scripts/build-release.sh)-ldflags="-s -w -X main.version=${VERSION}"make buildbehavior2. Updated Release Workflow (
.github/workflows/release.yml)3. Comprehensive Tests
cmd/gh-aw/version_test.go) verify version can be overridden at build timescripts/test-build-release.sh) validate the complete build script functionalityVerification
Manual testing with a test version demonstrates the fix:
Impact
After this change is merged and included in the next release, users installing via
gh extension install githubnext/gh-awwill see the correct release version (e.g.,v0.22.5) instead of "dev", making it easier to:All existing tests pass, and the solution uses minimal changes to achieve the desired behavior.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.