Detect sdk version

This commit is contained in:
your_username 2026-02-22 23:18:01 -05:00
parent 4c79e4a23c
commit af49297ef9

View file

@ -56,6 +56,25 @@ jobs:
}
"WIDGET_PACKAGE_VERSION=$widgetVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$minTpv = [version]"10.0.18362.0"
$unionMetadataRoot = Join-Path ${env:ProgramFiles(x86)} "Windows Kits\10\UnionMetadata"
if (-not (Test-Path $unionMetadataRoot)) {
throw "UWP UnionMetadata folder not found at '$unionMetadataRoot'."
}
$detectedTpv = Get-ChildItem -Path $unionMetadataRoot -Directory |
Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } |
Where-Object { [version]$_.Name -ge $minTpv } |
Sort-Object { [version]$_.Name } -Descending |
Select-Object -First 1 -ExpandProperty Name
if (-not $detectedTpv) {
throw "No installed UWP TargetPlatformVersion >= $minTpv was found under '$unionMetadataRoot'."
}
Write-Host "Using UWP TargetPlatformVersion: $detectedTpv"
"UWP_TPV=$detectedTpv" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Restore PerformanceOverlay dependencies
run: dotnet restore PerformanceOverlay/PerformanceOverlay.csproj
@ -89,6 +108,8 @@ jobs:
/restore `
/p:Configuration=Release `
/p:Platform=x64 `
/p:TargetPlatformVersion=${{ env.UWP_TPV }} `
/p:TargetPlatformMinVersion=10.0.18362.0 `
/p:AppxBundle=Never `
/p:UapAppxPackageBuildMode=SideloadOnly `
/p:AppxPackageDir="$widgetPackageDir\\" `