Skip to content

Commit 546b8ef

Browse files
author
Hidetaka Okamoto
committed
chore: github actions
1 parent cc141d7 commit 546b8ef

File tree

4 files changed

+3357
-87
lines changed

4 files changed

+3357
-87
lines changed

.github/workflows/main.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- '!master'
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Begin CI...
12+
uses: actions/checkout@v2
13+
14+
- name: Use Node 12
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 12.x
18+
19+
- name: Use cached node_modules
20+
uses: actions/cache@v1
21+
with:
22+
path: node_modules
23+
key: nodeModules-${{ hashFiles('**/yarn.lock') }}
24+
restore-keys: |
25+
nodeModules-
26+
- name: Install dependencies
27+
run: yarn install --frozen-lockfile
28+
env:
29+
CI: true
30+
31+
- name: Lint
32+
run: yarn lint
33+
env:
34+
CI: true
35+
36+
- name: Test
37+
run: yarn test --ci --coverage --maxWorkers=2
38+
env:
39+
CI: true

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Release package"
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
release_package:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
13+
- name: "yarn install"
14+
run: yarn install --frozen-lockfile
15+
16+
- name: "npm run semantic-release"
17+
run: npm run semantic-release
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"globby": "^10",
3030
"husky": "^4.2.5",
3131
"lint-staged": "^10.2.11",
32+
"semantic-release": "^17.1.1",
3233
"ts-node": "^8",
3334
"typescript": "^3.3"
3435
},
@@ -75,7 +76,8 @@
7576
"prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
7677
"test": "echo NO TESTS",
7778
"lint": "eslint src/**/*.ts",
78-
"version": "oclif-dev readme && git add README.md"
79+
"version": "oclif-dev readme && git add README.md",
80+
"semantic-release": "semantic-release"
7981
},
8082
"types": "lib/index.d.ts"
8183
}

0 commit comments

Comments
 (0)