Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(ci): unblock Windows ARM64 release builds — winget not on PATH

Louis Beaumont3660dc2c6828
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index f802ac7b1..7571b0a9b 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -468,15 +468,35 @@ jobs:
if: matrix.os_type == 'windows' && matrix.target == 'aarch64-pc-windows-msvc'
shell: powershell
run: |
- winget install Ninja-build.Ninja --accept-package-agreements --accept-source-agreements --silent
+ # The windows-11-arm runner image pre-installs Ninja at C:\Tools\Ninja
+ # but winget is NOT on PATH by default — so blindly calling
+ # `winget install` fails with CommandNotFoundException and kills
+ # the build even though Ninja is already available. Check first,
+ # fall back to winget only if both the pre-installed path AND the
+ # winget CLI are present.
$paths = @("C:\Program Files\Ninja", "C:\Tools\Ninja")
- foreach ($p in $paths) {
- if (Test-Path "$p\ninja.exe") {
- echo $p | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- break
+ $found = $paths | Where-Object { Test-Path "$_\ninja.exe" } | Select-Object -First 1
+
+ if (-not $found) {
+ Write-Host "Ninja not found in preinstalled paths, trying winget..."
+ if (Get-Command winget -ErrorAction SilentlyContinue) {
+ winget install Ninja-build.Ninja --accept-package-agreements --accept-source-agreements --silent
+ $found = $paths | Where-Object { Test-Path "$_\ninja.exe" } | Select-Object -First 1
+ } else {
+ Write-Host "winget unavailable on this runner — downloading Ninja release zip"
+ $zip = "$env:RUNNER_TEMP\ninja.zip"
+ Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/latest/download/ninja-winarm64.zip" -OutFile $zip
+ $dest = "C:\Tools\Ninja"
+ New-Item -ItemType Directory -Force -Path $dest | Out-Null
+ Expand-Archive -Path $zip -DestinationPath $dest -Force
+ $found = $dest
}
}
- $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
+
+ if (-not $found) { throw "Ninja not found and could not be installed" }
+ Write-Host "Using Ninja at: $found"
+ echo $found | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+ $env:Path = "$found;" + $env:Path
ninja --version
- name: Install wget on Windows