Skip to content

Commit c25692e

Browse files
committed
chore(ci): fix build error
1 parent a850d3c commit c25692e

1 file changed

Lines changed: 20 additions & 19 deletions

File tree

.github/workflows/build-ci.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,82 +23,83 @@ jobs:
2323
toolchain: stable
2424
override: true
2525

26-
# Ignore lines containing 'version = "x.x.x"' and hash the rest of Cargo.lock
26+
# Generate custom cache key from Cargo.toml
2727
- name: Generate custom cache key
2828
id: cargo-hash
2929
run: |
3030
grep -v '^version = ' src-tauri/Cargo.toml | shasum -a 256 | awk '{ print $1 }' > cargo_hash.txt
3131
echo "CARGO_CACHE_KEY=$(cat cargo_hash.txt)" >> $GITHUB_ENV
32-
echo "::set-output name=CARGO_CACHE_KEY::$(cat cargo_hash.txt)"
3332
33+
# Cache Rust crates
3434
- name: Cache Cargo registry
3535
uses: actions/cache@v4
3636
with:
3737
path: ~/.cargo/registry
38-
key: ${{ runner.os }}-cargo-registry-${{ steps.cargo-hash.outputs.CARGO_CACHE_KEY }}
38+
key: ${{ runner.os }}-cargo-registry-${{ env.CARGO_CACHE_KEY }}
3939
restore-keys: |
4040
${{ runner.os }}-cargo-registry-
4141
4242
- name: Cache Cargo git index
4343
uses: actions/cache@v4
4444
with:
4545
path: ~/.cargo/git
46-
key: ${{ runner.os }}-cargo-git-${{ steps.cargo-hash.outputs.CARGO_CACHE_KEY }}
46+
key: ${{ runner.os }}-cargo-git-${{ env.CARGO_CACHE_KEY }}
4747
restore-keys: |
4848
${{ runner.os }}-cargo-git-
4949
5050
- name: Cache Cargo target directory
5151
uses: actions/cache@v4
5252
with:
5353
path: src-tauri/target
54-
key: ${{ runner.os }}-cargo-target-${{ matrix.target }}-${{ steps.cargo-hash.outputs.CARGO_CACHE_KEY }}-$(rustc --version)
54+
key: ${{ runner.os }}-cargo-target-${{ env.CARGO_CACHE_KEY }}-$(rustc --version)
5555
restore-keys: |
5656
${{ runner.os }}-cargo-target-
5757
58-
- name: Cache Tauri CLI (cross-platform)
58+
# Cache Tauri CLI binary
59+
- name: Cache Tauri CLI
5960
id: tauri-cli-cache
6061
uses: actions/cache@v4
6162
with:
6263
path: |
6364
~/.cargo/bin/cargo-tauri
6465
~/.cargo/bin/cargo-tauri.exe
65-
key: ${{ runner.os }}-tauri-cli-${{ steps.cargo-hash.outputs.CARGO_CACHE_KEY }}
66+
key: ${{ runner.os }}-tauri-cli-${{ env.CARGO_CACHE_KEY }}
6667
restore-keys: |
6768
${{ runner.os }}-tauri-cli-
6869
69-
- name: Cache pnpm store and modules
70+
# Cache only pnpm store, avoid node_modules symlink issues
71+
- name: Cache pnpm store
7072
uses: actions/cache@v4
7173
with:
72-
path: |
73-
~/.pnpm-store
74-
node_modules
75-
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
74+
path: ~/.pnpm-store
75+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
7676
restore-keys: |
77-
${{ runner.os }}-pnpm-
77+
${{ runner.os }}-pnpm-store-
7878
79-
- name: Install Node Module
79+
# Install frontend dependencies
80+
- name: Install Node modules
8081
run: |
81-
npm i pnpm -g
82+
npm install -g pnpm
8283
echo "C:/Users/runneradmin/AppData/Roaming/npm" >> $GITHUB_PATH
83-
pnpm i
84+
pnpm install --frozen-lockfile --store ~/.pnpm-store
8485
8586
- name: Install Protoc
8687
uses: arduino/setup-protoc@v3
8788
with:
8889
version: "22.2"
8990

9091
- name: Install Tauri CLI if not cached
91-
run: cargo install tauri-cli --version ^2.0.0
9292
if: steps.tauri-cli-cache.outputs.cache-hit != 'true'
93+
run: cargo install tauri-cli --version ^2.0.0
9394

94-
- name: Build
95+
- name: Build with Tauri
9596
run: cargo tauri build
9697
working-directory: ./src-tauri
9798

9899
- name: Create output directory
99100
run: mkdir output
100101

101-
- name: Copy files to output
102+
- name: Copy executable
102103
run: cp src-tauri/target/release/bundle/nsis/*.exe output/
103104

104105
- name: Upload artifact

0 commit comments

Comments
 (0)