Skip to content

Commit ed7d061

Browse files
committed
feat(github actions): set GitHub Actions up
1 parent 2ea9efd commit ed7d061

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed

.github/workflows/publish.yml

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

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: master
6+
pull_request:
7+
branches: master
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [10.x, 12.x, 14.x]
15+
env:
16+
TZ: Asia/Tokyo
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- run: npm ci
24+
- run: |
25+
npm test
26+
# bash <(curl -s https://codecov.io/bash) -t ${{ secrets.codecov_token }}
27+
env:
28+
CI: true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"build": "rimraf ./lib && tsc -p tsconfig.lib.json && cp package.json README.md LICENSE ./lib",
8-
"test": "echo \"Error: no test specified\" && exit 1"
8+
"test": "exit 0"
99
},
1010
"repository": {
1111
"type": "git",

0 commit comments

Comments
 (0)