Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix(bundle): 元数据与版本号也取自 release 提交

hairyfdba3893c5d19
diff --git a/.github/workflows/release-bundle.yml b/.github/workflows/release-bundle.yml
index 9420ecb4..33641b5c 100644
--- a/.github/workflows/release-bundle.yml
+++ b/.github/workflows/release-bundle.yml
@@ -49,16 +49,16 @@ jobs:
outputs:
should_build: ${{ steps.release.outputs.should_build }}
tag: ${{ steps.release.outputs.tag }}
- version: ${{ steps.release.outputs.version }}
+ version: ${{ steps.meta.outputs.version }}
source_ref: ${{ steps.release.outputs.source_ref }}
dsh_tag: ${{ steps.meta.outputs.dsh_tag }}
dsh_commit: ${{ steps.meta.outputs.dsh_commit }}
steps:
- - name: Checkout release commit
+ - name: Checkout triggering commit
uses: actions/checkout@v7
with:
- # workflow_run 用触发运行时的 head_sha(即 release.yml 真正构建的提交),
- # 手动触发用当前 ref。
+ # 只用它推导默认 tag:workflow_run 用触发运行时的 head_sha(release.yml 真正
+ # 构建的提交),手动触发用当前 ref。真正的构建源在下面按 tag 重新签出。
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}
fetch-depth: 0
# 不把仓库写令牌留在 .git/config 里(后续步骤不需要 push)。
@@ -87,7 +87,6 @@ jobs:
tag="v$version"
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- echo "version=$version" >> "$GITHUB_OUTPUT"
if ! gh release view "$tag" >/dev/null 2>&1; then
echo "should_build=false" >> "$GITHUB_OUTPUT"
@@ -110,12 +109,27 @@ jobs:
echo "should_build=true" >> "$GITHUB_OUTPUT"
echo "offline bundle target release: $tag ($version) from $tag_commit"
+ # 构建源、元数据与版本号必须来自同一个提交:上面只是按 tag 推导出 source_ref,
+ # 工作区还停在触发 ref 上。这里重新签出 release 提交,后面的 constants.rs /
+ # version-recommend.json / package.json 与最终产物版本都以它为准。
+ - name: Checkout release commit
+ if: steps.release.outputs.should_build == 'true'
+ uses: actions/checkout@v7
+ with:
+ ref: ${{ steps.release.outputs.source_ref }}
+ fetch-depth: 0
+ persist-credentials: false
+
- name: Resolve bundle metadata
id: meta
if: steps.release.outputs.should_build == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: node scripts/bundle-metadata.mjs
+ run: |
+ set -euo pipefail
+ # 产物名里的版本号取自 release 提交,而不是触发 dispatch 的那个 ref。
+ echo "version=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT"
+ node scripts/bundle-metadata.mjs
build-macos:
name: Build macOS Offline Bundle