Skip to content

👾 Open Computer Use – Open-Source Alternative to Codex Computer Use

Use Node 24 for npm trusted publishing

Leo6b7cc38a84a9
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1c93241..ff5457e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -33,12 +33,14 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
- node-version: "22"
+ node-version: "24"
- - name: Set up npm trusted publishing CLI
+ - name: Check npm trusted publishing CLI
run: |
- npm install -g [email protected]
- npm --version
+ node --version
+ npm_version="$(npm --version)"
+ echo "npm ${npm_version}"
+ node -e 'const [major, minor] = process.argv[1].split(".").map(Number); if (major < 11 || (major === 11 && minor < 5)) { console.error(`npm ${process.argv[1]} is too old for trusted publishing; need 11.5.1+`); process.exit(1); }' "${npm_version}"
- name: Prepare Open Computer Use signing config
env:
diff --git a/docs/histories/2026-04/20260422-1205-harden-npm-release-retry.md b/docs/histories/2026-04/20260422-1205-harden-npm-release-retry.md
index 272e627..518bbfc 100644
--- a/docs/histories/2026-04/20260422-1205-harden-npm-release-retry.md
+++ b/docs/histories/2026-04/20260422-1205-harden-npm-release-retry.md
@@ -10,7 +10,7 @@
- **[Publish Recovery]**: `scripts/npm/publish-packages.mjs` 发布每个 staged package 前先用 `npm view <name>@<version>` 检查同版本是否已经存在;存在时直接跳过。
- **[Auth Preference]**: GitHub Actions 暴露 OIDC 时优先用 `--provenance` 走 npm trusted publishing,不再因为存在 `NPM_TOKEN` fallback 就强制清掉 OIDC 环境;token 仅作为 fallback。
-- **[Trusted Publishing CLI]**: release workflow 在 publish 前固定升级到 npm `11.12.1`,满足 npm trusted publishing 对 CLI `11.5.1+` 的要求。
+- **[Trusted Publishing CLI]**: release workflow 的 npm package job 改用 Node `24`,并在 publish 前检查 npm CLI 至少为 `11.5.1`,满足 npm trusted publishing 的要求。
- **[Retry]**: npm publish 失败后最多重试 3 次,并在每次失败后再次检查版本是否已经对 registry 可见,用于覆盖 registry 短暂错误或部分发布成功场景。
- **[Release Guide]**: 在发版指南中补充 npm publish 404 的排查方式,以及 tag 重发时脚本如何处理已存在版本。
diff --git a/docs/releases/RELEASE_GUIDE.md b/docs/releases/RELEASE_GUIDE.md
index a84a2f1..c3ebc33 100644
--- a/docs/releases/RELEASE_GUIDE.md
+++ b/docs/releases/RELEASE_GUIDE.md
@@ -108,7 +108,7 @@ gh run view -R iFurySt/open-codex-computer-use <run-id> --log-failed
- 先确认 registry 上目标包旧版本是否仍可见:`npm view <package> versions --json`。
- 当前 publish 脚本会在发布前跳过已经存在的同版本 package,并对 publish 失败做短暂重试;如果 GitHub Actions OIDC 可用,会优先用 `--provenance` 走 trusted publishing,再回退到 `NODE_AUTH_TOKEN`。如果 tag 重发前某个 package 已经部分发布成功,重新跑同一个 release 不会因为该 package 已存在而中断。
- `npm error need auth ... You need to authorize this machine using npm adduser`
- - 如果日志显示已经选择 `GitHub Actions OIDC trusted publishing`,优先检查 CI 里的 npm CLI 版本;trusted publishing 需要 npm `11.5.1+`,当前 release workflow 会先升级到 npm `11.12.1`。
+ - 如果日志显示已经选择 `GitHub Actions OIDC trusted publishing`,优先检查 CI 里的 npm CLI 版本;trusted publishing 需要 npm `11.5.1+`,当前 release workflow 的 npm package job 使用 Node `24` 并显式检查 npm 版本。
- 如果 npm CLI 版本满足要求仍报这个错误,说明 npmjs.com 包侧还没有把当前 GitHub repo / workflow 文件配置成 trusted publisher。
- 构建阶段失败
- 优先看 `Build npm release artifacts`、`Build Cursor Motion DMG` 或 Swift 编译错误。