Skip to content

Commit fed365e

Browse files
Merge pull request #1 from simonsinclair/actions
Add Publish and CI actions
2 parents e09effb + 70b3fd1 commit fed365e

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: CI
2+
on: push
3+
jobs:
4+
test:
5+
name: Node.js ${{ matrix.node-version }}
6+
runs-on: ubuntu-latest
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
node-version: [12.x, 14.x]
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v2
14+
with:
15+
node-version: ${{ matrix.node-version }}
16+
- run: npm ci
17+
- run: npm test

.github/workflows/publish.yml

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

0 commit comments

Comments
 (0)