Skip to content

Commit 6d8a368

Browse files
committed
Update GitHub actions
1 parent f894eb7 commit 6d8a368

File tree

2 files changed

+34
-13
lines changed

2 files changed

+34
-13
lines changed

.github/workflows/npm-publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 16
15+
- run: yarn && yarn test
16+
17+
publish:
18+
needs: test
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-node@v2
23+
with:
24+
node-version: 16
25+
- run: yarn && yarn build
26+
- run: npm publish --tag next
27+
env:
28+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/tests.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
name: Tests
1+
name: Run tests
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
8-
9-
# Allows you to run this workflow manually from the Actions tab
10-
workflow_dispatch:
7+
branches: [master]
118

129
jobs:
13-
build:
10+
test:
1411
runs-on: ubuntu-latest
15-
1612
steps:
1713
- uses: actions/checkout@v2
1814
- uses: actions/setup-node@v2
1915
with:
20-
node-version: '14'
21-
- name: Install dependencies
22-
run: yarn
23-
- name: Run tests
24-
run: yarn test
16+
node-version: 16
17+
- run: yarn && yarn test

0 commit comments

Comments
 (0)