Skip to content

Commit 4f1e9fb

Browse files
authored
Update npmpublish.yml
1 parent 6052ee0 commit 4f1e9fb

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

.github/workflows/npmpublish.yml

Lines changed: 18 additions & 6 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/get-tag@v2.1
15+
id: tagName
1416
- uses: actions/checkout@v2
1517
- uses: actions/setup-node@v1
1618
with:
17-
node-version: 12
19+
node-version: 16
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/get-tag@v2.1
31+
id: tagName
2532
- uses: actions/checkout@v2
2633
- uses: actions/setup-node@v1
2734
with:
28-
node-version: 12
35+
node-version: 16
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,14 +47,17 @@ jobs:
3847
needs: build
3948
runs-on: ubuntu-latest
4049
steps:
50+
- uses: olegtarasov/get-tag@v2.1
51+
id: tagName
4152
- uses: actions/checkout@v2
4253
- uses: actions/setup-node@v1
4354
with:
44-
node-version: 12
55+
node-version: 16
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
4962
env:
5063
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
51-

0 commit comments

Comments
 (0)