ci: use dependency-only hash for Rust cache key to survive version bumps

This commit is contained in:
t8y2
2026-05-04 18:58:23 +08:00
parent f97c9da11d
commit cdd64c9edf
+8 -1
View File
@@ -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)