Skip to content

Commit 855934f

Browse files
committed
github(workflows): add npm publish workflow
Signed-off-by: TRACTION <19631364+iamtraction@users.noreply.github.com>
1 parent 0d8a42d commit 855934f

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This workflow will run tests using node and then publish a package to npm when a release is created
2+
3+
name: Node.js Package
4+
5+
on:
6+
release:
7+
types: [ created ]
8+
9+
jobs:
10+
release:
11+
name: Release
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
registry-url: https://registry.npmjs.org/
23+
24+
- name: Dependencies
25+
run: npm install
26+
27+
- name: Test
28+
run: npm test
29+
env:
30+
CI: true
31+
32+
- name: Build
33+
run: npm run build
34+
35+
- name: Publish
36+
run: npm publish
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}

0 commit comments

Comments
 (0)