From cdd64c9edf1be39705a4b1cd6f72577dd29d1c16 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Mon, 4 May 2026 18:58:23 +0800 Subject: [PATCH] ci: use dependency-only hash for Rust cache key to survive version bumps --- .github/workflows/release.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index afb617948..eb8466be0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,11 +45,18 @@ jobs: with: targets: ${{ matrix.target }} + - name: Compute dependency hash (excludes app version from Cargo.lock) + id: deps-hash + shell: bash + run: | + hash=$(sed '/^name = "dbx"$/,/^$/{ /^version = /d }' src-tauri/Cargo.lock | shasum -a 256 | cut -d' ' -f1) + echo "hash=${hash:0:20}" >> "$GITHUB_OUTPUT" + - name: Rust cache uses: swatinem/rust-cache@v2 with: workspaces: './src-tauri -> target' - shared-key: release-${{ matrix.target }} + shared-key: release-${{ matrix.target }}-${{ steps.deps-hash.outputs.hash }} cache-on-failure: true - name: Install Apple certificate (macOS)