Skip to content

Commit 38627ad

Browse files
committed
fix: optimize release workflow and package config
- Update Node.js version to 24 in CI for latest stable environment. - Switch to yarn npm publish to maintain package manager consistency. - Simplify bin field in package.json for single binary definition. - Remove redundant release.sh script to centralize deployment logic.
1 parent 27cdc15 commit 38627ad

5 files changed

Lines changed: 17 additions & 31 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,16 @@ permissions:
1111
contents: read
1212
id-token: write
1313

14+
1415
jobs:
1516
publish:
1617
runs-on: ubuntu-latest
1718
steps:
1819
- uses: actions/checkout@v4
19-
20-
# 3. 环境配置 (修复 ENEEDAUTH 认证错误)
21-
- name: Setup Node.js
22-
uses: actions/setup-node@v4
20+
- uses: actions/setup-node@v4
2321
with:
24-
node-version: '20'
25-
# 必须指定 registry-url,setup-node 才会生成带 Auth 的 .npmrc
22+
node-version: '24'
2623
registry-url: 'https://registry.npmjs.org'
27-
28-
- name: Install dependencies
29-
run: yarn install
30-
31-
- name: Build project
32-
run: yarn build
33-
34-
# 4. 发布命令 (开启 Provenance)
35-
- name: Publish to NPM
36-
env:
37-
# 读取 GitHub Secrets 中的 Token
38-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39-
# --provenance: 生成来源证明
40-
# --access public: 确保发布为公开包
41-
run: npm publish --provenance --access public
24+
- run: yarn install
25+
- run: yarn run build
26+
- run: yarn npm publish

.yarn/install-state.gz

672 Bytes
Binary file not shown.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"files": [
77
"dist"
88
],
9-
"bin": {
10-
"docusaurus-docs-to-pdf": "dist/main.js"
11-
},
9+
"bin": "dist/main.js",
1210
"repository": {
1311
"type": "git",
1412
"url": "git+https://github.com/fastone-open/docusaurus-docs-to-pdf.git"

release.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

yarn.lock

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,16 @@ __metadata:
4747
languageName: node
4848
linkType: hard
4949

50-
"@types/node@npm:*, @types/node@npm:^24.0.13":
50+
"@types/node@npm:*":
51+
version: 25.0.10
52+
resolution: "@types/node@npm:25.0.10"
53+
dependencies:
54+
undici-types: "npm:~7.16.0"
55+
checksum: 10c0/9edc3c812b487c32c76eebac7c87acae1f69515a0bc3f6b545806d513eb9e918c3217bf751dc93da39f60e06bf1b0caa92258ef3a6dd6457124b2e761e54f61f
56+
languageName: node
57+
linkType: hard
58+
59+
"@types/node@npm:^24.0.13":
5160
version: 24.10.9
5261
resolution: "@types/node@npm:24.10.9"
5362
dependencies:

0 commit comments

Comments
 (0)