From 931a6c074705354c7babf2d13126451072f3a61d Mon Sep 17 00:00:00 2001 From: scawful Date: Wed, 15 Oct 2025 09:34:28 -0400 Subject: [PATCH] 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. --- .github/workflows/ci.yml | 16 +--------------- .github/workflows/release.yml | 16 +--------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5054d7d..c030051d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a418c89..a1e01259 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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'