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:
24
24
go-version-file : go.mod
25
25
cache : false
26
26
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
+
27
34
- name : Set up GoReleaser
28
35
uses : goreleaser/goreleaser-action@v6
29
36
with :
30
37
version : v2.1.0
31
38
args : release -f=.goreleaser-alauda.yml
32
39
env :
33
40
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:
22
22
goarch :
23
23
- amd64
24
24
- 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}}
27
28
main : ./cmd/golangci-lint/
28
29
binary : alauda-golangci-lint
29
30
You can’t perform that action at this time.
0 commit comments