Skip to content

Commit 9147da9

Browse files
Add GitHub action to publish package to NPM automatically.
1 parent c6d7d55 commit 9147da9

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/publish-npm.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
CI:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: 12
15+
- run: npm ci
16+
- run: npm test
17+
- run: npm run lint
18+
19+
Publish:
20+
needs: CI
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions/setup-node@v1
25+
with:
26+
node-version: 12
27+
registry-url: https://registry.npmjs.org/
28+
- run: npm ci
29+
- run: npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 commit comments

Comments
 (0)