Skip to content

Commit 5c7686f

Browse files
authored
将 CI 从 trivas 切换为 github actions (#584)
* 添加 actions 脚本 * 移除 travis 配置文件 * 优化 publish 的触发阶段
1 parent e180bea commit 5c7686f

File tree

4 files changed

+58
-31
lines changed

4 files changed

+58
-31
lines changed

.github/workflows/dev-check.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Dev check
2+
3+
on: [pull_request,push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: actions/setup-node@v3
11+
with:
12+
cache: 'npm'
13+
node-version: 12
14+
- run: npm install
15+
- run: npm run lint
16+
test:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: actions/setup-node@v3
21+
with:
22+
cache: 'npm'
23+
node-version: 12
24+
- run: npm install
25+
- run: npm run test
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v3
30+
- uses: actions/setup-node@v3
31+
with:
32+
cache: 'npm'
33+
node-version: 12
34+
- run: npm install
35+
- run: npm run build

.github/workflows/npm-publish.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Npm publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: 12
15+
registry-url: https://registry.npmjs.org/
16+
- run: npm install
17+
- run: npm run build
18+
- run: npm publish
19+
env:
20+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.npmignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ node_modules
33
bower_components
44
deploy.sh
55
npm-debug.log
6-
test/config.json
6+
.github
7+
.vscode
8+
test
79
site

.travis.yml

-30
This file was deleted.

0 commit comments

Comments
 (0)