Skip to content

Commit f85446c

Browse files
committed
fix: a bug fixed
1 parent c6c220e commit f85446c

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ on:
55
push:
66
branches:
77
- main
8-
# paths:
9-
# - src/**
10-
pull_request:
11-
branches:
12-
- main
13-
# paths:
14-
# - src/**
158

169
# 任务
1710
jobs:
@@ -25,21 +18,23 @@ jobs:
2518
- name: Use Node.js
2619
uses: actions/setup-node@v3
2720
with:
28-
node-version: 16.14.x
21+
node-version: 18.12.x
2922
registry-url: 'https://registry.npmjs.org'
3023
cache: 'npm'
3124

3225
# 执行测试和打包操作
3326
- run: npm ci
3427

3528
# lint check
36-
- run: npm run lint
29+
# - run: npm run lint
3730

3831
# 这条命令包含了测试和上传覆盖率
39-
- run: npm run coveralls
32+
# - run: npm run coveralls
4033

4134
# 打包发布
4235
- run: npm run build --if-present
43-
- run: npm publish
36+
- name: Release
37+
run: npm run release
4438
env:
45-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ALOVA_PUBLISH_TOKEN }}
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
"build:umd": "cross-env NODE_ENV=development rollup -c ./config/rollup.config.umd.js",
3131
"build:umd.min": "cross-env NODE_ENV=production rollup -c ./config/rollup.config.umd.js",
3232
"build": "npm run clean && npm run build:esm && npm run build:umd && npm run build:umd.min",
33-
"release": "npm publish",
34-
"coveralls": "npm run test:coverage && coveralls < coverage/lcov.info"
33+
"release": "semantic-release --branches main",
34+
"coveralls": "npm run test:coverage && coveralls < coverage/lcov.info",
35+
"commit": "git add . && git-cz && git push"
3536
},
3637
"publishConfig": {
3738
"access": "public"
@@ -64,8 +65,10 @@
6465
"alova": "^2.0.4",
6566
"axios": "^1.3.4",
6667
"babel-jest": "^29.2.2",
68+
"commitizen": "^4.3.0",
6769
"coveralls": "^3.1.1",
6870
"cross-env": "5.2.0",
71+
"cz-conventional-changelog": "^3.3.0",
6972
"eslint": "^8.35.0",
7073
"eslint-config-prettier": "^8.6.0",
7174
"eslint-plugin-prettier": "^4.2.1",
@@ -79,11 +82,17 @@
7982
"rollup": "^2.74.1",
8083
"rollup-plugin-terser": "^7.0.2",
8184
"rollup-plugin-typescript2": "^0.31.2",
85+
"semantic-release": "^21.0.1",
8286
"ts-jest": "^29.0.3",
8387
"ts-jest-mock-import-meta": "^1.0.0",
8488
"ts-node": "^10.9.1",
8589
"tslib": "^2.4.0",
8690
"typescript": "^4.7.2",
8791
"vue": "^3.2.47"
92+
},
93+
"config": {
94+
"commitizen": {
95+
"path": "./node_modules/cz-conventional-changelog"
96+
}
8897
}
8998
}

0 commit comments

Comments
 (0)