Skip to content

Commit 03cbefc

Browse files
authored
Add script to publish to npm on tagged releases.
1 parent 057d968 commit 03cbefc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: npm publish
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
13+
- name: Install Node
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: '14.x'
17+
registry-url: 'https://registry.npmjs.org'
18+
19+
- name: Install Dependencies
20+
run: yarn
21+
22+
- name: Build & Test
23+
run: yarn build && yarn test
24+
25+
- name: Publish npm package
26+
run: yarn publish
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)