Skip to content

Commit 5b85d70

Browse files
committed
(actions) add publish workflow
1 parent bb99a68 commit 5b85d70

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deployment
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
publish-npm:
10+
name: Publish to NPM
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: 14
17+
registry-url: 'https://registry.npmjs.org'
18+
- name: Install
19+
run: npm ci
20+
- name: Build
21+
run: npm run build
22+
- name: Test
23+
run: npm test
24+
- name: Create Release
25+
id: create-release
26+
uses: actions/create-release@v1
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
with:
30+
tag_name: ${{ github.ref }}
31+
release_name: ${{ github.ref }}
32+
draft: false
33+
prerelease: false
34+
- name: Publish
35+
run: npm publish
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)