Skip to content

Commit

Permalink
将 CI 从 trivas 切换为 github actions (#584)
Browse files Browse the repository at this point in the history
* 添加 actions 脚本

* 移除 travis 配置文件

* 优化 publish 的触发阶段
  • Loading branch information
yinxulai authored Jun 22, 2022
1 parent e180bea commit 5c7686f
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 31 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/dev-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Dev check

on: [pull_request,push]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 12
- run: npm install
- run: npm run lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 12
- run: npm install
- run: npm run test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 12
- run: npm install
- run: npm run build
20 changes: 20 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Npm publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ node_modules
bower_components
deploy.sh
npm-debug.log
test/config.json
.github
.vscode
test
site
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

0 comments on commit 5c7686f

Please sign in to comment.