fix(ci): use USERPROFILE and add rustup toolchain bin to PATH
Build Lotus Chat Desktop / prepare (push) Successful in 3s
Build Lotus Chat Desktop / build-linux (push) Successful in 24m56s
Build Lotus Chat Desktop / build-windows (push) Successful in 30m50s
Build Lotus Chat Desktop / update-manifest (push) Successful in 3s

The rustup shim at .cargo\bin\cargo.exe was failing with
"No application is associated with the specified file for
this operation" — a Windows error indicating the shim proxy
could not resolve the toolchain. Fix by also adding the
actual stable toolchain bin dir to PATH, bypassing the shim.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 23:54:01 -04:00
parent f70f749216
commit ff3d4b4a18
+7 -1
View File
@@ -89,7 +89,13 @@ jobs:
# Retry transient network errors before failing.
CARGO_NET_RETRY: '5'
run: |
$env:PATH = "C:\Users\$env:USERNAME\.cargo\bin;$env:PATH"
# USERPROFILE is set by Windows directly; more reliable than C:\Users\$USERNAME
$env:PATH = "$env:USERPROFILE\.cargo\bin;$env:PATH"
# Also add the actual toolchain bin to bypass rustup shim execution issues
$toolchain = Get-ChildItem "$env:USERPROFILE\.rustup\toolchains" -Directory -ErrorAction SilentlyContinue |
Where-Object { $_.Name -match 'stable' } | Select-Object -First 1
if ($toolchain) { $env:PATH = "$($toolchain.FullName)\bin;$env:PATH" }
Write-Host "cargo: $((Get-Command cargo -ErrorAction SilentlyContinue).Source)"
cargo --version
npm run tauri -- build --bundles nsis