Skip to content

Commit 10c7d89

Browse files
committed
chore(ci): ci 修复
1 parent c3a0b4a commit 10c7d89

File tree

2 files changed

+6
-27
lines changed

2 files changed

+6
-27
lines changed

.github/workflows/npm-publish.yml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,7 @@ jobs:
2323
ls -al
2424
pnpm i
2525
pnpm build
26-
- name: Upload Build Artifacts
27-
uses: actions/upload-artifact@v4
28-
with:
29-
name: build-artifacts # 构建产物名称
30-
path: ./dist # 构建产物路径
31-
32-
publish-npm:
33-
needs: build
34-
runs-on: ubuntu-latest
35-
steps:
36-
- name: Checkout repository
37-
uses: actions/checkout@v4
38-
- name: Set up Node.js
39-
uses: actions/setup-node@v4
40-
with:
41-
node-version: 20
42-
registry-url: https://registry.npmjs.org/
43-
- name: Download Build Artifacts
44-
uses: actions/download-artifact@v4
45-
with:
46-
name: build-artifacts # 构建产物名称,需与上传时的名称一致
47-
path: ./ # 下载后存放路径
48-
- name: List Build Directory
49-
run: ls -al ./
26+
npm publish
5027
- name: Publish to NPM
5128
run: npm publish
5229
env:

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"CHANGELOG.md"
1313
],
1414
"scripts": {
15-
"prepare": "husky",
15+
"prepare": "is-ci || husky",
1616
"commit": "git-cz",
1717
"lint": "eslint src/**/*.ts --fix",
1818
"lint:check": "eslint src/**/*.ts",
@@ -22,7 +22,8 @@
2222
"release": "semantic-release --no-ci",
2323
"release:ci": "semantic-release",
2424
"dev": "rollup -c -w",
25-
"lint-staged": "lint-staged"
25+
"lint-staged": "lint-staged",
26+
"prepublishOnly": "npm run build --no-git-hooks"
2627
},
2728
"keywords": [
2829
"websocket",
@@ -63,6 +64,7 @@
6364
"rollup-plugin-delete": "^3.0.1",
6465
"semantic-release": "^24.2.3",
6566
"tslib": "^2.8.1",
66-
"typescript-eslint": "^8.31.0"
67+
"typescript-eslint": "^8.31.0",
68+
"is-ci": "^3.0.1"
6769
}
6870
}

0 commit comments

Comments
 (0)