From 991b4c1959e6ace7c66ed7c2b9bad94989e37480 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Jul 2026 16:14:51 +0000 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E7=94=A8=20.node-version=20?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E9=BB=98=E8=AE=A4=20CI=20Node=EF=BC=88DRY?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ee7a9f5 将 ootb 升到 Node 24 后,npm-publish 仍钉 22.22 且注释声称与 ootb 对齐。 抽出仓库根 .node-version 作为唯一权威;ootb/npm-publish 经 node-version-file 消费。 release 仍故意用 Node 26(SEA target)。顺带将 checkout/setup-node 升到 v5,消除 Node 20 runtime 弃用告警。 Co-authored-by: Shiroha --- .github/workflows/npm-publish.yml | 8 ++++---- .github/workflows/ootb.yml | 11 ++++++----- .github/workflows/release.yml | 8 ++++---- .node-version | 1 + 4 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 .node-version diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 6e43fab0..34d999f8 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -31,12 +31,12 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v5 with: - # 与 ootb.yml 对齐: npm-run-all2 等要求 ≥22.22; db-server 需 ≥22.13 - node-version: "22.22" + # 与 ootb.yml 共用 .node-version(DRY);勿在此再写死另一份版本号 + node-version-file: .node-version cache: npm registry-url: https://registry.npmjs.org diff --git a/.github/workflows/ootb.yml b/.github/workflows/ootb.yml index e40a5bfd..f72cdee3 100644 --- a/.github/workflows/ootb.yml +++ b/.github/workflows/ootb.yml @@ -12,14 +12,15 @@ jobs: timeout-minutes: 15 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: - # db-server 在模块加载时 import node:sqlite,22.5–22.12 需 --experimental-sqlite; - # npm-run-all2@9 等 dev 依赖要求 ≥22.22.2。22.22 同时满足两者。 - node-version: "24" + # 默认 CI Node 唯一来源: 仓库根 .node-version(与 npm-publish 共用)。 + # db-server 需 ≥22.13(node:sqlite 无 flag);npm-run-all2@9 要求 + # ^22.22.2 || ^24.15.0 || >=26 —— 当前钉 24(GHA 解析到 ≥24.15)。 + node-version-file: .node-version cache: npm - name: Install root deps diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8283d380..fbed6093 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,11 +22,11 @@ jobs: node-mirror: darwin-x64 runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v5 with: - # SEA bundle 目标 node26(见 build-sea.mjs target) + # 故意独立于 .node-version:SEA bundle 目标 node26(见 build-sea.mjs target) node-version: "26" cache: npm @@ -66,7 +66,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: actions/download-artifact@v4 with: diff --git a/.node-version b/.node-version new file mode 100644 index 00000000..a45fd52c --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +24