Skip to content

Commit afa9a45

Browse files
committed
TEST
1 parent 47c1a3e commit afa9a45

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.github/workflows/tests.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ jobs:
4747

4848
# Read existing version, reuse that, add a Git short hash
4949
- name: Set build version to Git commit
50-
run: npm version "$(npm pkg get version | sed 's/"//g')-$(git rev-parse --short HEAD)"
50+
run: >
51+
GIT_REV=$(git rev-parse --short HEAD)
52+
node scripts/writeGitVersion.js $GIT_REV
53+
54+
- name: Check updated version
55+
run: jq .version package.json
5156

5257
- name: Pack
5358
run: yarn pack
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const path = require('path')
2+
const fs = require('fs')
3+
4+
const gitRev = process.argv[2]
5+
6+
const packagePath = path.join(__dirname, '../package.json')
7+
const pkg = require(packagePath)
8+
9+
pkg.version = `${pkg.version}-${gitRev}`
10+
fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2))

0 commit comments

Comments
 (0)