Skip to content

Commit be27734

Browse files
committed
ci: unify Go version management in CI and release workflows
- Add step ID to Go setup in the GitHub Actions workflow to enable output reference - Pass Go version from the setup-go action as an environment variable to subsequent steps - Update GoVersion linker flag to use GO_VERSION environment variable instead of GOVERSION in the release configuration Signed-off-by: appleboy <[email protected]>
1 parent 306b713 commit be27734

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.github/workflows/goreleaser.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
fetch-depth: 0
1919

2020
- name: Setup go
21+
id: setup-go
2122
uses: actions/setup-go@v5
2223
with:
2324
go-version-file: go.mod
@@ -32,3 +33,4 @@ jobs:
3233
args: release --clean
3334
env:
3435
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
GO_VERSION: ${{ steps.setup-go.outputs.go-version }}

.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ builds:
6363
- -X 'github.com/appleboy/CodeGPT/version.Version={{.Version}}'
6464
- -X 'github.com/appleboy/CodeGPT/version.BuildTime={{.Date}}'
6565
- -X 'github.com/appleboy/CodeGPT/version.GitCommit={{.FullCommit}}'
66-
- -X 'github.com/appleboy/CodeGPT/version.GoVersion={{.Env.GOVERSION}}'
66+
- -X 'github.com/appleboy/CodeGPT/version.GoVersion={{.Env.GO_VERSION}}'
6767
- -X 'github.com/appleboy/CodeGPT/version.BuildOS={{.Os}}'
6868
- -X 'github.com/appleboy/CodeGPT/version.BuildArch={{.Arch}}'
6969
binary: >-

0 commit comments

Comments
 (0)