Skip to content

Commit ab863e9

Browse files
authored
Update npmpublish.yml
1 parent 4f77c0a commit ab863e9

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/npmpublish.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,38 @@ name: Node.js Package
55

66
on:
77
release:
8-
types: [created]
8+
types: [published]
99

1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14+
- uses: olegtarasov/[email protected]
15+
id: tagName
1416
- uses: actions/checkout@v2
1517
- uses: actions/setup-node@v1
1618
with:
1719
node-version: 12
20+
- name: update the version with TAG
21+
run: echo $(jq --arg a "$GIT_TAG_NAME" '.version = ($a)' package.json) > package.json
1822
- run: yarn install
19-
- run: yarn build
23+
- run: yarn build
24+
2025

2126
publish-npm:
2227
needs: build
2328
runs-on: ubuntu-latest
2429
steps:
30+
- uses: olegtarasov/[email protected]
31+
id: tagName
2532
- uses: actions/checkout@v2
2633
- uses: actions/setup-node@v1
2734
with:
2835
node-version: 12
2936
registry-url: https://registry.npmjs.org/
3037
scope: openimis
38+
- name: update the version with TAG
39+
run: echo $(jq --arg a "$GIT_TAG_NAME" '.version = ($a)' package.json) > package.json
3140
- run: yarn install
3241
- run: yarn build
3342
- run: npm publish --access public
@@ -38,11 +47,15 @@ jobs:
3847
needs: build
3948
runs-on: ubuntu-latest
4049
steps:
50+
- uses: olegtarasov/[email protected]
51+
id: tagName
4152
- uses: actions/checkout@v2
4253
- uses: actions/setup-node@v1
4354
with:
4455
node-version: 12
4556
registry-url: https://npm.pkg.github.com/
57+
- name: update the version with TAG
58+
run: echo $(jq --arg a "$GIT_TAG_NAME" '.version = ($a)' package.json) > package.json
4659
- run: yarn install
4760
- run: yarn build
4861
- run: npm publish

0 commit comments

Comments
 (0)