Skip to content

Commit b3de816

Browse files
authored
Merge pull request #4 from gchq/workflow
create release workflow
2 parents d60140a + 231392c commit b3de816

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/release.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish node.js package to npm
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [10.x, 12.x]
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- run: npm install
23+
- run: npm run build --if-present
24+
- run: npm run lint-test
25+
- run: npm test
26+
27+
publish-npm:
28+
needs: build
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v1
32+
- uses: actions/setup-node@v1
33+
with:
34+
node-version: 10
35+
registry-url: https://registry.npmjs.org/
36+
- run: npm ci
37+
- run: npm publish
38+
env:
39+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)