From 276179339e017c434c1bbe994d5a76813ce1855e Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Fri, 27 Feb 2026 07:42:57 -0800 Subject: [PATCH] Fix Windows build: use cmd shell with explicit PATH 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 --- .gitea/workflows/build-app.yml | 53 ++++++++++++++++------------------ 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/.gitea/workflows/build-app.yml b/.gitea/workflows/build-app.yml index 8a8e641..f1d252a 100644 --- a/.gitea/workflows/build-app.yml +++ b/.gitea/workflows/build-app.yml @@ -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