Skip to content

Commit e74df48

Browse files
authored
fix: auto release on action (#22)
1 parent 3e3416d commit e74df48

File tree

3 files changed

+31
-45
lines changed

3 files changed

+31
-45
lines changed

.github/workflows/nodejs.yml

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,18 @@
1-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
4-
name: Node.js CI
1+
name: CI
52

63
on:
74
push:
8-
branches:
9-
- main
10-
- master
11-
pull_request:
12-
branches:
13-
- main
14-
- master
15-
schedule:
16-
- cron: '0 2 * * *'
17-
18-
jobs:
19-
build:
20-
runs-on: ${{ matrix.os }}
21-
22-
strategy:
23-
fail-fast: false
24-
matrix:
25-
node-version: [14, 16, 18]
26-
os: [ubuntu-latest]
5+
branches: [ master ]
276

28-
steps:
29-
- name: Checkout Git Source
30-
uses: actions/checkout@v2
31-
32-
- name: Use Node.js ${{ matrix.node-version }}
33-
uses: actions/setup-node@v3
34-
with:
35-
node-version: ${{ matrix.node-version }}
36-
37-
- name: Install Dependencies
38-
run: npm i
7+
pull_request:
8+
branches: [ master ]
399

40-
- name: Continuous Integration
41-
run: npm run ci
10+
workflow_dispatch: {}
4211

43-
- name: Code Coverage
44-
uses: codecov/codecov-action@v3
45-
with:
46-
token: ${{ secrets.CODECOV_TOKEN }}
12+
jobs:
13+
Job:
14+
name: Node.js
15+
uses: artusjs/github-actions/.github/workflows/node-test.yml@v1
16+
with:
17+
os: 'ubuntu-latest'
18+
version: '14, 16, 18'

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release
2+
3+
on:
4+
# 合并后自动发布
5+
push:
6+
branches: [ master ]
7+
8+
# 手动发布
9+
workflow_dispatch: {}
10+
11+
jobs:
12+
release:
13+
name: Node.js
14+
uses: artusjs/github-actions/.github/workflows/node-release.yml@v1
15+
secrets:
16+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
17+
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
18+
with:
19+
checkTest: false

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"@types/node": "^14.18.34",
4141
"co-mocha": "^1.2.2",
4242
"egg-bin": "^5.5.0",
43-
"egg-ci": "^2.2.0",
4443
"eslint": "^8.29.0",
4544
"eslint-config-egg": "^12.1.0",
4645
"git-contributor": "^1.1.0",
@@ -51,9 +50,5 @@
5150
},
5251
"engine": {
5352
"node": ">= 14.0.0"
54-
},
55-
"ci": {
56-
"version": "14, 16, 18",
57-
"os": "linux"
5853
}
5954
}

0 commit comments

Comments
 (0)