Skip to content

Commit 574645f

Browse files
committed
fix: build version issue
1 parent 60d1d79 commit 574645f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ jobs:
121121
GOTOOLCHAIN: go1.25.0+auto
122122
run: |
123123
VERSION="v${{ needs.semantic-release.outputs.version }}"
124-
LDFLAGS="-s -w -X ${VERSION_PKG}.Version=${VERSION}"
124+
COMMIT="${{ github.sha }}"
125+
BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
126+
LDFLAGS="-s -w -X ${VERSION_PKG}.Version=${VERSION} -X ${VERSION_PKG}.Commit=${COMMIT:0:7} -X ${VERSION_PKG}.BuildDate=${BUILD_DATE}"
125127
mkdir -p release
126128
127129
GOOS=linux GOARCH=amd64 go build -ldflags="${LDFLAGS}" -o release/ggo-linux-amd64 ./cmd/ggo

0 commit comments

Comments
 (0)