diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index d1cf9fa..2fd3740 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -66,12 +66,21 @@ jobs: - name: Add Rust to PATH shell: powershell run: | - $cargoDir = "$env:USERPROFILE\.cargo\bin" - if (Test-Path $cargoDir) { - Add-Content -Path $env:GITHUB_PATH -Value $cargoDir - Write-Host "Added $cargoDir to GITHUB_PATH" - } else { - Write-Error "Rust not found at $cargoDir — install rustup on this runner first" + $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 }