Skip to content

Commit 3f4fafc

Browse files
authored
Update npm-publish.yml
1 parent 9021cc1 commit 3f4fafc

1 file changed

Lines changed: 35 additions & 2 deletions

File tree

.github/workflows/npm-publish.yml

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

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

1010
jobs:
1111
build:
@@ -28,6 +28,39 @@ jobs:
2828
node-version: 16
2929
registry-url: https://registry.npmjs.org/
3030
- run: npm ci
31-
- run: npm publish
31+
- run: npm publish --tag ${{ github.event.release.tag_name }}
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
34+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
35+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
36+
37+
name: Node.js Package
38+
39+
on:
40+
release:
41+
types: [published]
42+
43+
jobs:
44+
build:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v3
48+
- uses: actions/setup-node@v3
49+
with:
50+
node-version: 16
51+
- run: npm ci
52+
- run: npm test
53+
54+
publish-npm:
55+
needs: build
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v3
59+
- uses: actions/setup-node@v3
60+
with:
61+
node-version: 16
62+
registry-url: https://registry.npmjs.org/
63+
- run: npm ci
64+
- run: npm publish --tag ${{ github.event.release.tag_name }}
3265
env:
3366
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)