dsh-sweeper 1.4.1 → 1.4.2

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 +24 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -41,9 +41,30 @@ dsh plugin add dsh-sweeper
41
41
  npm 上这个包喂给官方 `dsh-plugin-catalog` 索引,插件商店里因此能显示版本号;
42
42
  Release 与 npm 的内容一致,选哪条都行。
43
43
 
44
- 发版走 npm 的**暂存区**:CI 只负责 `npm stage publish`,最后一步要维护者用 2FA
45
- 批准(`npm stage list` 看 id,`npm stage approve <id>`),所以一个被偷的 token
46
- 没法直接把代码送到用户面前。
44
+ ### 发版
45
+
46
+ 发版是自动的:在 Actions 里跑 **release**(`gh workflow run release -f bump=patch`),
47
+ 它会跑完整测试、bump 版本、打 tag、发 GitHub Release,随后 **publish** 把这一版
48
+ 送到 npm。想先确认会发生什么,加 `-f dry_run=true`:只跑测试并打印新版本号,
49
+ 不打 tag、不发 Release。
50
+
51
+ npm 那边用**受信任发布(trusted publishing)**,不需要在仓库里存 token,也不
52
+ 需要每次人工批准:发布时 GitHub Actions 用 OIDC 向 npm 换一张短期凭证,npm 据此
53
+ 签发 provenance。一次性配置在 npmjs.com:**package → Settings → Trusted
54
+ publishing → Add publisher → GitHub Actions**,填
55
+
56
+ | 字段 | 值 |
57
+ | --- | --- |
58
+ | Organization or user | `Dushiqi1987` |
59
+ | Repository | `dsh-sweeper` |
60
+ | Workflow filename | `publish.yml` |
61
+ | Environment | 留空 |
62
+ | Allowed actions | `npm publish` |
63
+
64
+ 配好之后每次 Release 都直接进 npm。没配也不要紧:`publish` 会先看仓库里有没有
65
+ `NPM_TOKEN` secret,有就用 token 发,没有就走 OIDC,两者都不可用时这一步**故意
66
+ 失败**——一个悄悄没进 npm 的 Release 比一条红色流水线更难发现。
67
+
47
68
 
48
69
  ## 怎么用
49
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-sweeper",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "type": "module",
5
5
  "description": "清理对话留下的临时文件与垃圾,释放磁盘空间;只报告,清理进回收站可恢复 (cleanup junk files conversations leave on disk, free up space)",
6
6
  "keywords": [