Skip to content

Commit a3624dc

Browse files
authored
Create publish.yml
1 parent a996ed8 commit a3624dc

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.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
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: "14.x"
15+
registry-url: https://registry.npmjs.org/
16+
- uses: actions/cache@v2
17+
with:
18+
path: ~/.npm
19+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
20+
restore-keys: |
21+
${{ runner.os }}-node-
22+
- run: npm ci
23+
- run: npm test
24+
- run: npm publish --access=public
25+
env:
26+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
27+
- uses: actions/setup-node@v2
28+
with:
29+
registry-url: https://npm.pkg.github.com/
30+
- run: npm publish
31+
env:
32+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)