Skip to content

Commit c493b3a

Browse files
committed
ci: add publish.yml workflow
1 parent e7f5af9 commit c493b3a

File tree

3 files changed

+2282
-281
lines changed

3 files changed

+2282
-281
lines changed

.github/workflows/publish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [16.x]
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v2
21+
with:
22+
node-verison: ${{ matrix.node-version }}
23+
registry-url: 'https://registry.npmjs.org'
24+
25+
- name: Cache Node.js modules
26+
uses: actions/cache@v2
27+
with:
28+
# npm cache files are stored in `~/.npm` on Linux/macOS
29+
path: ~/.npm
30+
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
31+
restore-keys: |
32+
${{ runner.OS }}-node-
33+
${{ runner.OS }}-
34+
35+
- name: Install dependencies
36+
run: npm ci
37+
38+
- run: npm publish
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
42+
- name: Release
43+
uses: softprops/action-gh-release@v1
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)