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:
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@@ -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'
|
||||
|
||||
16
.github/workflows/release.yml
vendored
16
.github/workflows/release.yml
vendored
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user