File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,18 @@ jobs:
2424 go-version-file : go.mod
2525 cache : false
2626
27+ - name : Generate Version
28+ id : generate_version
29+ run : |
30+ # remove "alauda-" prefix
31+ GENERATED_VERSION=$(echo "${{ github.ref_name }}" | sed 's/alauda-//')
32+ echo "GENERATED_VERSION=$GENERATED_VERSION" >> $GITHUB_OUTPUT
33+
2734 - name : Set up GoReleaser
2835 uses : goreleaser/goreleaser-action@v6
2936 with :
3037 version : v2.1.0
3138 args : release -f=.goreleaser-alauda.yml
3239 env :
3340 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41+ GENERATED_VERSION : ${{ steps.generate_version.outputs.GENERATED_VERSION }}
Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ builds:
2222 goarch :
2323 - amd64
2424 - arm64
25- ldflags :
26- - -w -s -extldflags '-static'
25+ flags :
26+ - -trimpath
27+ ldflags : -s -w -X main.version={{.Env.GENERATED_VERSION}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}}
2728 main : ./cmd/golangci-lint/
2829 binary : alauda-golangci-lint
2930
You can’t perform that action at this time.
0 commit comments