Skip to content

Commit a78fbd2

Browse files
committed
CI: add a workflow for release
1 parent ef666b2 commit a78fbd2

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.github/workflows/release.yml

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

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*/
2+
!/.github/
23
!/.vscode/
34
!/types/
4-
!/utils/
5+
!/utils/

0 commit comments

Comments
 (0)