Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Mar 13, 2023
1 parent 47c1a3e commit 077c9cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ jobs:

# Read existing version, reuse that, add a Git short hash
- name: Set build version to Git commit
run: npm version "$(npm pkg get version | sed 's/"//g')-$(git rev-parse --short HEAD)"
run: node scripts/writeGitVersion.js $(git rev-parse --short HEAD)

- name: Check updated version
run: jq .version package.json

- name: Pack
run: yarn pack
Expand Down
10 changes: 10 additions & 0 deletions packages/toolkit/scripts/writeGitVersion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const path = require('path')
const fs = require('fs')

const gitRev = process.argv[2]

const packagePath = path.join(__dirname, '../package.json')
const pkg = require(packagePath)

pkg.version = `${pkg.version}-${gitRev}`
fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2))

0 comments on commit 077c9cf

Please sign in to comment.