@yangzhenchen/dsh-balance 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +17 -5
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -112,12 +112,24 @@ GitHub / link 安装不会有一键更新(DSH 的版本区块只覆盖 registr
112
112
 
113
113
  ## 发布
114
114
 
115
- 1. 改版本:`npm version patch`(或手改 `package.json` 的 `version`)并提交。
116
- 2. 打标签并推送:`git tag -a v0.5.0 -m "0.5.0"; git push origin main --tags`
117
- 3. 发布到 npm:`pnpm publish --access public`
118
- 4. 客户端在插件页点**刷新**,就能看到「可更新到 0.5.0」。
115
+ 发布走 GitHub Actions + **Trusted Publishing(OIDC)**,不需要长期 npm token:
119
116
 
120
- 包名固定为 `@yangzhenchen/dsh-balance`(`publishConfig.access` 已设为 `public`);`dsh-plugin-balance` 是别人的包,不要用它发布。
117
+ 1. 改版本:手改 `package.json` 的 `version`(例如 0.4.3),提交并推送 `main`。
118
+ 2. 打标签并推送:`git tag -a v0.4.3 -m "0.4.3"; git push origin main --tags`
119
+ 3. GitHub Actions([`.github/workflows/release.yml`](.github/workflows/release.yml))会用 OIDC 临时凭证发布到 npm;它先校验 tag 与 `package.json` 版本一致、跑完四组测试,再 `npm publish --access public --provenance`。
120
+ 4. 客户端在插件页点**刷新**,就能看到「可更新到 0.4.3」。
121
+
122
+ **一次性配置**(只需做一次):npmjs.com → 包 `@yangzhenchen/dsh-balance` → Settings → **Trusted Publisher** → GitHub Actions:
123
+
124
+ | 字段 | 值 |
125
+ | --- | --- |
126
+ | Organization or user | `yang-zhenchen` |
127
+ | Repository | `dsh-balance` |
128
+ | Workflow filename | `release.yml` |
129
+ | Environment name | 留空 |
130
+ | Allowed actions | 勾上 **npm publish**(只留 stage publish 的话不会直接上线) |
131
+
132
+ 配好后旧 token 可以全部删掉。包名固定为 `@yangzhenchen/dsh-balance`(`publishConfig.access` 已设为 `public`);`dsh-plugin-balance` 是别人的包,不要用它发布。
121
133
 
122
134
  ## 启动失败:`Unexpected token '' ... is not valid JSON`
123
135
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yangzhenchen/dsh-balance",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,6 +21,9 @@
21
21
  "platform": "web"
22
22
  }
23
23
  },
24
+ "scripts": {
25
+ "test": "node test/smoke.mjs && node test/usage.mjs && node test/account.mjs && node test/host.mjs"
26
+ },
24
27
  "files": [
25
28
  "lib",
26
29
  "scripts",
@@ -54,8 +57,5 @@
54
57
  },
55
58
  "peerDependencies": {
56
59
  "@deepseek-ai/cordis": "~4.0.5"
57
- },
58
- "scripts": {
59
- "test": "node test/smoke.mjs && node test/usage.mjs && node test/account.mjs && node test/host.mjs"
60
60
  }
61
- }
61
+ }