From df96be9af9f009978e649c4c6e71dd8532c03f22 Mon Sep 17 00:00:00 2001 From: hfshfg <38004547@qq.com> Date: Wed, 17 Jun 2026 17:27:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(release):=20=E6=A1=8C=E9=9D=A2=E7=89=88?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E8=B7=9F=20git=20tag=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前 electron-builder 从 package.json 取版本号(写死 2.1.4), 导致 dmg/exe 文件名与 git tag(v2.1.5)脱节。 - 两个 electron build job 在构建前用 tag 号同步 package.json (npm version --no-git-tag-version),文件名自动跟 tag 走 - bump package.json 到 2.1.5 保持本地一致 Co-Authored-By: Claude Opus 4.8 --- .github/workflows/release.yml | 17 +++++++++++++++++ u-claw-app/package.json | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6579b11..c5bdb56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -182,6 +182,15 @@ jobs: cd u-claw-app npm install --registry=https://registry.npmmirror.com + - name: Sync version from tag + shell: bash + run: | + tag_name="${GITHUB_REF_NAME:-${{ github.event.inputs.tag }}}" + ver="${tag_name#v}" # strip leading v -> 2.1.5 + cd u-claw-app + npm version "$ver" --no-git-tag-version --allow-same-version + echo "桌面版版本号已同步为 $ver" + - name: Build Windows installer shell: cmd run: | @@ -213,6 +222,14 @@ jobs: cd u-claw-app npm install --registry=https://registry.npmmirror.com + - name: Sync version from tag + run: | + tag_name="${GITHUB_REF_NAME:-${{ github.event.inputs.tag }}}" + ver="${tag_name#v}" # strip leading v -> 2.1.5 + cd u-claw-app + npm version "$ver" --no-git-tag-version --allow-same-version + echo "桌面版版本号已同步为 $ver" + - name: Build macOS DMG run: | cd u-claw-app diff --git a/u-claw-app/package.json b/u-claw-app/package.json index de2af4b..2336a5b 100644 --- a/u-claw-app/package.json +++ b/u-claw-app/package.json @@ -1,6 +1,6 @@ { "name": "u-claw", - "version": "2.1.4", + "version": "2.1.5", "description": "U-Claw - AI 助手桌面版,插上 U 盘就能用", "main": "src/main.js", "author": "U-Claw (https://u-claw.org)",