fix(ci): set cargo PATH inline in Build step
GITHUB_PATH written by a prior step is not reliably picked up by act (the local runner). Set PATH directly in the Build step's PowerShell session so cargo.exe is visible to tauri build. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -63,27 +63,6 @@ jobs:
|
||||
$ver = '${{ needs.prepare.outputs.version }}'
|
||||
node -e "const fs=require('fs');const d=JSON.parse(fs.readFileSync('src-tauri/tauri.conf.json','utf8'));d.version='$ver';fs.writeFileSync('src-tauri/tauri.conf.json',JSON.stringify(d,null,2),'utf8');"
|
||||
|
||||
- name: Add Rust to PATH
|
||||
shell: powershell
|
||||
run: |
|
||||
$candidates = @(
|
||||
"$env:USERPROFILE\.cargo\bin",
|
||||
"C:\Users\$env:USERNAME\.cargo\bin"
|
||||
)
|
||||
$added = $false
|
||||
foreach ($dir in $candidates) {
|
||||
if (Test-Path "$dir\cargo.exe") {
|
||||
Add-Content -Path $env:GITHUB_PATH -Value $dir
|
||||
Write-Host "Added $dir to GITHUB_PATH"
|
||||
$added = $true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (-not $added) {
|
||||
Write-Error "cargo.exe not found - install rustup on this runner"
|
||||
exit 1
|
||||
}
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: src-tauri
|
||||
@@ -109,7 +88,10 @@ jobs:
|
||||
CARGO_HTTP_MULTIPLEXING: 'false'
|
||||
# Retry transient network errors before failing.
|
||||
CARGO_NET_RETRY: '5'
|
||||
run: npm run tauri -- build --bundles nsis
|
||||
run: |
|
||||
$env:PATH = "C:\Users\$env:USERNAME\.cargo\bin;$env:PATH"
|
||||
cargo --version
|
||||
npm run tauri -- build --bundles nsis
|
||||
|
||||
- name: Upload to release
|
||||
shell: powershell
|
||||
|
||||
Reference in New Issue
Block a user