Skip to content

ci: publish npm only for a tag a person chooses - #181

Merged
zuohaisu merged 1 commit into
mainfrom
agent/chore-manual-npm-publish
Oct 17, 2026
Merged

zuohaisu merged 1 commit into
mainfrom
agent/chore-manual-npm-publish

Conversation

@zuohaisu

Copy link
Copy Markdown
Owner

Summary

推送 v* 标签不再自动把包装上 npm。标签推送仍然构建 macOS 安装包并创建 GitHub Release。要发表 npm 时,在 Actions 里手动运行 Publish npm,填一个已经有 GitHub Release 的标签。

Refs #180

验收标准

  • release.yml 的标签推送路径里没有 npm publish。
  • 手动工作流要求填写标签;标签不是 v*、或版本和 Cargo.toml 不一致时,工作流里的检查会失败。没有对应 GitHub Release 时,gh release download 会失败。
  • 有 NPM_TOKEN 且上述检查通过时,按 arm64、x64、wrapper 的顺序发表到 registry.npmjs.org。这次没有真的发表。
  • packaging/npm/README.md 和 AGENTS.md 的发版说明与这条路径一致。

证据(Validation)

$ git grep -n "npm publish" -- .github/workflows/release.yml
(无输出)

$ python3 -c '…Cargo.toml version…'
0.3.9

$ python3 packaging/npm/prepare-packages.py --version 0.3.9 --bin-arm64 <temp> --bin-x64 <temp>
prepared viva-darwin-arm64@0.3.9
prepared viva-darwin-x64@0.3.9
prepared viva@0.3.9

$ python3 packaging/npm/check-staged-versions.py 0.3.9
(退出码 0)

$ python3 packaging/npm/check-staged-versions.py 9.9.9
viva-darwin-arm64 staged 0.3.9, expected 9.9.9
(退出码 1)

$ git diff --check
(无输出)

没有跑 cargo test --workspace:这次没有改 Rust 产品代码。没有跑这个新工作流,也没有对 npm 发表任何版本。

风险与安全边界(Risk/Safety Boundaries)

只改 GitHub Actions 的触发方式、发版说明和发表前的版本检查。不改版本号,不改 NPM_TOKEN 的权限,不在这次发表任何包。标签推送仍会创建公开的 GitHub Release。

未验证项(Known Limitations)

手动工作流还没有对一个真实标签跑过。NPM_TOKEN 缺失、Release 不存在、以及 npm 上已有同一版本时的失败,是工作流里的分支,这次没有在 Actions 里执行。

下一步:等独立 QA 对当前 head 给出可合并结论。

Made with Cursor

A v* tag still builds the GitHub Release. npm publish no longer starts from that push.

Co-authored-by: Cursor <cursoragent@cursor.com>
@zuohaisu
zuohaisu merged commit 320fa9f into main Oct 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant