Skip to content

Commit e01de8b

Browse files
committed
chore: publish action
1 parent 45e716d commit e01de8b

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v1
13+
14+
- name: Setup node
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 12
18+
registry-url: https://registry.npmjs.org/
19+
20+
- name: Get yarn cache directory path
21+
id: yarn-cache-dir-path
22+
run: echo "::set-output name=dir::$(yarn cache dir)"
23+
24+
- uses: actions/cache@v1.1.2
25+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
26+
with:
27+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
28+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-yarn-
31+
32+
- name: Install packages
33+
run: yarn install
34+
35+
- name: Test
36+
run: yarn test
37+
38+
- name: Build
39+
run: yarn build
40+
41+
- name: Publish
42+
run: npm publish --access public
43+
env:
44+
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

0 commit comments

Comments
 (0)