fix(ci): simplify Ninja installation for Windows in CI and release workflows

- Replaced the PowerShell script for installing Ninja with a Chocolatey command, streamlining the installation process.
- This change enhances reliability and reduces complexity in the setup for Windows environments.

Benefits:
- Improves the efficiency of the build setup on Windows by ensuring a straightforward installation method for Ninja.
This commit is contained in:
scawful
2025-10-15 09:34:28 -04:00
parent d5a9c6432d
commit 931a6c0747
2 changed files with 2 additions and 30 deletions

View File

@@ -71,21 +71,7 @@ jobs:
- name: Install Ninja (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$ninjaDir = Join-Path $env:RUNNER_TEMP "ninja"
New-Item -ItemType Directory -Force -Path $ninjaDir | Out-Null
Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip" -OutFile "$ninjaDir\ninja.zip"
Expand-Archive "$ninjaDir\ninja.zip" -DestinationPath $ninjaDir -Force
$ninjaExe = Join-Path $ninjaDir "ninja.exe"
if (-not (Test-Path $ninjaExe)) {
Write-Host "::error::ninja.exe not found after extraction"
exit 1
}
Write-Host "Ninja installed at $ninjaExe"
"$ninjaDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
$env:PATH = "$ninjaDir;$env:PATH"
& $ninjaExe --version
run: choco install ninja --no-progress -y
- name: Set up vcpkg (Windows)
if: runner.os == 'Windows'

View File

@@ -145,21 +145,7 @@ jobs:
- name: "Install Ninja (Windows only)"
if: runner.os == 'Windows'
shell: pwsh
run: |
$ninjaDir = Join-Path $env:RUNNER_TEMP "ninja"
New-Item -ItemType Directory -Force -Path $ninjaDir | Out-Null
Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip" -OutFile "$ninjaDir\ninja.zip"
Expand-Archive "$ninjaDir\ninja.zip" -DestinationPath $ninjaDir -Force
$ninjaExe = Join-Path $ninjaDir "ninja.exe"
if (-not (Test-Path $ninjaExe)) {
Write-Host "::error::ninja.exe not found after extraction"
exit 1
}
Write-Host "Ninja installed at $ninjaExe"
"$ninjaDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
$env:PATH = "$ninjaDir;$env:PATH"
& $ninjaExe --version
run: choco install ninja --no-progress -y
- name: "Set up vcpkg (Windows only)"
if: runner.os == 'Windows'