Skip to content

Commit 077c9cf

Browse files
committed
TEST
1 parent 47c1a3e commit 077c9cf

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ 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: node scripts/writeGitVersion.js $(git rev-parse --short HEAD)
51+
52+
- name: Check updated version
53+
run: jq .version package.json
5154

5255
- name: Pack
5356
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)