Skip to content

Commit a253951

Browse files
committed
put git commit in the program version
1 parent b338fc8 commit a253951

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ jobs:
5757
# build-release.js does the same replacement for npm publish,
5858
# but we use sed here to keep the binary build independent.
5959
TAG="${GITHUB_REF#refs/tags/}"
60-
echo "Injecting version: ${TAG}"
61-
sed -i "s/const programVersion = '\[dev\]'/const programVersion = '${TAG}'/" cli.mjs
60+
SHA=$(git rev-parse --short HEAD)
61+
VERSION="${TAG} (${SHA})"
62+
echo "Injecting version: ${VERSION}"
63+
sed -i "s/const programVersion = '\[dev\]'/const programVersion = '${VERSION}'/" cli.mjs
6264
6365
# Sanity check: make sure the replacement actually worked
6466
grep "programVersion" cli.mjs

0 commit comments

Comments
 (0)