Skip to content

Commit b477746

Browse files
committed
Script to update version
1 parent 652e832 commit b477746

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.github/workflows/building-bundle.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
- name: Publish Hexa VSCode bundle
6767
if: github.event_name == 'release' && github.event.action == 'created'
6868
run: |
69+
node tagToVersion.js ${{ github.ref_name }}
6970
npx vsce publish
7071
env:
7172
VSCE_PAT: ${{ secrets.VSCE_PAT }}

tagToVersion.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const fs = require('fs')
2+
const ref = process.argv.pop().trim()
3+
const tag = ref.split('v').pop()
4+
console.log({ref, tag })
5+
6+
function update(file, pattern) {
7+
const json = fs.readFileSync(file).toString()
8+
fs.writeFileSync(file, json.split(pattern).join(tag))
9+
}
10+
11+
update('package.json', "0.2.1")
12+
update('package-lock.json', "0.1.2")

0 commit comments

Comments
 (0)