Skip to content

Commit b9ed067

Browse files
committed
fix version info
1 parent e655ddf commit b9ed067

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,14 @@ jobs:
3232
run: |
3333
VERSION=$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1) | tr -d v)
3434
[ "$VERSION" != "" ] || VERSION=0.0.0
35-
ITERATION=$(git rev-list --count --all || echo 0)
36-
COMMIT="$(git rev-parse --short HEAD || echo 0)"
37-
BRANCH="$(git rev-parse --abbrev-ref HEAD || echo unknown)"
35+
REVISION=$(git rev-list --count --all || echo 0)
36+
COMMIT=$(echo "${{github.sha}}" | head -c 7)
3837
jq ".info.productVersion = \"${VERSION}\"" wails.json > wails.json.new
3938
mv wails.json.new wails.json
40-
VERSION_LDFLAGS="-X \"golift.io/version.Branch=${BRANCH} ${COMMIT}\" \
39+
VERSION_LDFLAGS="-X \"golift.io/version.Branch=${{github.ref_name}} \(${COMMIT}\)\" \
4140
-X \"golift.io/version.BuildDate=$(date -u +%Y-%m-%dT%H:%M:00Z)\" \
4241
-X \"golift.io/version.BuildUser=$(whoami || echo "unknown")\" \
43-
-X \"golift.io/version.Revision=${ITERATION}\" \
42+
-X \"golift.io/version.Revision=${REVISION}\" \
4443
-X \"golift.io/version.Version=${VERSION}\""
4544
echo "VERSION_LDFLAGS=${VERSION_LDFLAGS}" >> $GITHUB_ENV
4645

0 commit comments

Comments
 (0)