Skip to content

Commit e11f663

Browse files
committed
chore: Add GitHub Actions workflow to publish to npm
1 parent 567fff7 commit e11f663

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: '14'
19+
20+
- name: Install dependencies
21+
run: npm install
22+
23+
- name: Run build script
24+
run: npm run build
25+
26+
- name: Update package version
27+
run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version
28+
29+
- name: Publish to npm
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
run: npm publish

0 commit comments

Comments
 (0)