From bb398e829c0d8eb19d323979ada77d1554491d0d Mon Sep 17 00:00:00 2001 From: scawful Date: Mon, 13 Oct 2025 21:15:45 -0400 Subject: [PATCH] fix(ci): improve vcpkg root detection in CI and release workflows - Added checks to set the vcpkgRoot variable from environment variables RUNVCPKG_VCPKG_ROOT and VCPKG_ROOT if it is not already defined. - Enhances the reliability of vcpkg setup by ensuring the correct root path is utilized during the build process. Benefits: - Increases robustness in CI and release workflows by providing fallback options for vcpkg root detection, improving build consistency. --- .github/workflows/ci.yml | 6 ++++++ .github/workflows/release.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bb812e2..4f6ff291 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,6 +103,12 @@ jobs: if ([string]::IsNullOrWhiteSpace($vcpkgRoot)) { $vcpkgRoot = "${{ steps.vcpkg_retry.outputs.vcpkgRoot }}" } + if ([string]::IsNullOrWhiteSpace($vcpkgRoot) -and $env:RUNVCPKG_VCPKG_ROOT) { + $vcpkgRoot = $env:RUNVCPKG_VCPKG_ROOT + } + if ([string]::IsNullOrWhiteSpace($vcpkgRoot) -and $env:VCPKG_ROOT) { + $vcpkgRoot = $env:VCPKG_ROOT + } if ([string]::IsNullOrWhiteSpace($vcpkgRoot)) { Write-Host "::error::lukka/run-vcpkg did not emit vcpkgRoot" exit 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 228f857a..4b374c36 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -177,6 +177,12 @@ jobs: if ([string]::IsNullOrWhiteSpace($vcpkgRoot)) { $vcpkgRoot = "${{ steps.vcpkg_retry.outputs.vcpkgRoot }}" } + if ([string]::IsNullOrWhiteSpace($vcpkgRoot) -and $env:RUNVCPKG_VCPKG_ROOT) { + $vcpkgRoot = $env:RUNVCPKG_VCPKG_ROOT + } + if ([string]::IsNullOrWhiteSpace($vcpkgRoot) -and $env:VCPKG_ROOT) { + $vcpkgRoot = $env:VCPKG_ROOT + } if ([string]::IsNullOrWhiteSpace($vcpkgRoot)) { Write-Host "::error::lukka/run-vcpkg did not emit vcpkgRoot" exit 1