Fix Windows build: use cmd shell with explicit PATH
Some checks failed
Build App / build-windows (push) Failing after 32s
Build App / build-linux (push) Has been cancelled

GITHUB_PATH file isn't picked up between steps on the Gitea runner.
Switch to cmd shell and prepend cargo/node to PATH in each step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 07:42:57 -08:00
parent da0b913c63
commit 276179339e

View File

@@ -76,54 +76,51 @@ jobs:
runs-on: windows-latest
defaults:
run:
shell: powershell
shell: cmd
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
run: |
if (!(Get-Command rustup -ErrorAction SilentlyContinue)) {
Invoke-WebRequest -Uri https://win.rustup.rs/x86_64 -OutFile rustup-init.exe
.\rustup-init.exe -y --default-toolchain stable
Remove-Item rustup-init.exe
} else {
where rustup >nul 2>&1 && (
rustup update stable
rustup default stable
}
# Add cargo to PATH for subsequent steps
echo "$env:USERPROFILE\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Verify Rust
run: |
rustc --version
cargo --version
) || (
curl -fSL -o rustup-init.exe https://win.rustup.rs/x86_64
rustup-init.exe -y --default-toolchain stable
del rustup-init.exe
)
- name: Install Node.js
run: |
if (!(Get-Command node -ErrorAction SilentlyContinue) -or !((node --version) -match 'v22')) {
# Download and install Node.js 22 LTS
Invoke-WebRequest -Uri "https://nodejs.org/dist/v22.14.0/node-v22.14.0-x64.msi" -OutFile node-install.msi
Start-Process msiexec.exe -ArgumentList '/i', 'node-install.msi', '/quiet', '/norestart' -Wait
Remove-Item node-install.msi
# Refresh PATH
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH", "User")
}
where node >nul 2>&1 && (
node --version
) || (
curl -fSL -o node-install.msi "https://nodejs.org/dist/v22.14.0/node-v22.14.0-x64.msi"
msiexec /i node-install.msi /quiet /norestart
del node-install.msi
)
- name: Verify tools
run: |
set "PATH=%USERPROFILE%\.cargo\bin;C:\Program Files\nodejs;%PATH%"
rustc --version
cargo --version
node --version
npm --version
- name: Install frontend dependencies
working-directory: ./app
run: npm ci
- name: Install Tauri CLI
working-directory: ./app
run: |
try { npx tauri --version } catch { npm install @tauri-apps/cli }
set "PATH=%USERPROFILE%\.cargo\bin;C:\Program Files\nodejs;%PATH%"
npm ci
- name: Build Tauri app
working-directory: ./app
run: npx tauri build
run: |
set "PATH=%USERPROFILE%\.cargo\bin;C:\Program Files\nodejs;%PATH%"
npx tauri build
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4