ci: use dependency-only hash for Rust cache key to survive version bumps
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user