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