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.
This commit is contained in:
scawful
2025-10-13 21:15:45 -04:00
parent 0db2f37798
commit bb398e829c
2 changed files with 12 additions and 0 deletions

View File

@@ -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

View File

@@ -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