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:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -103,6 +103,12 @@ jobs:
|
|||||||
if ([string]::IsNullOrWhiteSpace($vcpkgRoot)) {
|
if ([string]::IsNullOrWhiteSpace($vcpkgRoot)) {
|
||||||
$vcpkgRoot = "${{ steps.vcpkg_retry.outputs.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)) {
|
if ([string]::IsNullOrWhiteSpace($vcpkgRoot)) {
|
||||||
Write-Host "::error::lukka/run-vcpkg did not emit vcpkgRoot"
|
Write-Host "::error::lukka/run-vcpkg did not emit vcpkgRoot"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -177,6 +177,12 @@ jobs:
|
|||||||
if ([string]::IsNullOrWhiteSpace($vcpkgRoot)) {
|
if ([string]::IsNullOrWhiteSpace($vcpkgRoot)) {
|
||||||
$vcpkgRoot = "${{ steps.vcpkg_retry.outputs.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)) {
|
if ([string]::IsNullOrWhiteSpace($vcpkgRoot)) {
|
||||||
Write-Host "::error::lukka/run-vcpkg did not emit vcpkgRoot"
|
Write-Host "::error::lukka/run-vcpkg did not emit vcpkgRoot"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user