Skip to content

Commit b487569

Browse files
authored
👷 introduce github workflow (#94)
1 parent 80d7eb3 commit b487569

File tree

4 files changed

+66
-34
lines changed

4 files changed

+66
-34
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- next
9+
- 1.x
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [14.x, 16.x]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
27+
- name: Get yarn cache directory path
28+
id: yarn-cache-dir-path
29+
run: echo "::set-output name=dir::$(yarn cache dir)"
30+
31+
- uses: actions/cache@v2
32+
id: yarn-cache
33+
with:
34+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
35+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-yarn-
38+
- run: yarn
39+
- run: yarn ci
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish Latest Version
2+
3+
on:
4+
push:
5+
tags:
6+
- v3.*
7+
8+
jobs:
9+
publish:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- uses: actions/setup-node@v2
17+
with:
18+
node-version: '14.x'
19+
check-latest: true
20+
registry-url: 'https://registry.npmjs.org'
21+
22+
- run: yarn
23+
- run: yarn publish --tag latest
24+
env:
25+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.travis.yml

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"report": "nyc report --reporter=html",
3232
"codecov": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
3333
"coverageCheck": "nyc --check-coverage --lines 80 --functions 80 --branches 80 npm run test:pure",
34-
"lint": "tslint 'src/**/*.ts' & npm run coverageCheck"
34+
"lint": "tslint 'src/**/*.ts' & npm run coverageCheck",
35+
"ci": "npm run lint && npm run codecov"
3536
},
3637
"files": [
3738
"esm",

0 commit comments

Comments
 (0)