Skip to content

Commit 0be0072

Browse files
committed
ci: add publish phase
1 parent 9380f3f commit 0be0072

File tree

2 files changed

+29
-30
lines changed

2 files changed

+29
-30
lines changed

.github/workflows/nodejs.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,44 @@ on:
1010
branches: [master]
1111

1212
jobs:
13-
build:
13+
tests:
1414
runs-on: ubuntu-latest
15-
1615
strategy:
1716
matrix:
1817
node-version: [10.x, 12.x]
19-
2018
steps:
2119
- uses: actions/checkout@v2
2220
- name: Use Node.js ${{ matrix.node-version }}
2321
uses: actions/setup-node@v1
2422
with:
2523
node-version: ${{ matrix.node-version }}
26-
- run: yarn
27-
- run: yarn lint
28-
- run: yarn test
24+
- name: Install node_modules
25+
run: yarn
26+
- name: Lint & tscheck
27+
run: yarn lint
28+
- name: Tests
29+
run: yarn test
2930
env:
3031
CI: true
31-
- run: yarn build --if-present
32+
- name: Build
33+
run: yarn build
34+
35+
publish:
36+
if: github.ref == 'refs/heads/master'
37+
needs: [tests]
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: Use Node.js 12
42+
uses: actions/setup-node@v1
43+
with:
44+
node-version: 12.x
45+
- name: Install node_modules
46+
run: yarn install
47+
- name: Build
48+
run: yarn build
49+
- name: Semantic Release (publish to npm)
50+
run: yarn semantic-release
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)