Skip to content

Commit bc86a90

Browse files
author
guoyunlong.177
committed
ci: retry cargo dependency fetch
1 parent 864ef15 commit bc86a90

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
permissions:
1010
contents: write
1111

12+
env:
13+
CARGO_HTTP_MULTIPLEXING: "false"
14+
CARGO_NET_RETRY: "10"
15+
1216
jobs:
1317
build-windows:
1418
runs-on: windows-latest
@@ -40,6 +44,25 @@ jobs:
4044
- name: Install frontend dependencies
4145
run: pnpm install --frozen-lockfile
4246

47+
- name: Fetch Rust dependencies
48+
shell: pwsh
49+
run: |
50+
$attempts = 5
51+
for ($i = 1; $i -le $attempts; $i++) {
52+
cargo fetch --manifest-path src-tauri/Cargo.toml
53+
if ($LASTEXITCODE -eq 0) {
54+
exit 0
55+
}
56+
57+
if ($i -eq $attempts) {
58+
exit $LASTEXITCODE
59+
}
60+
61+
$delay = 15 * $i
62+
Write-Host "cargo fetch failed; retrying in $delay seconds ($i/$attempts)"
63+
Start-Sleep -Seconds $delay
64+
}
65+
4366
- name: Build portable executable
4467
run: pnpm tauri build --no-bundle
4568

0 commit comments

Comments
 (0)