Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ jobs:
$sdkVersion = Find-UsableSdkVersion $kitRoot
}
if (-not $sdkVersion) {
winget install --id Microsoft.WindowsWDK.10.0.26100 --exact --silent --accept-package-agreements --accept-source-agreements --disable-interactivity
winget install --id Microsoft.WindowsWDK.10.0.26100 --exact --silent `
--accept-package-agreements --accept-source-agreements --disable-interactivity
$kitRoot = $defaultKitRoot
$sdkVersion = Find-UsableSdkVersion $kitRoot
}
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ jobs:
$sdkVersion = Find-UsableSdkVersion $kitRoot
}
if (-not $sdkVersion) {
winget install --id Microsoft.WindowsWDK.10.0.26100 --exact --silent --accept-package-agreements --accept-source-agreements --disable-interactivity
winget install --id Microsoft.WindowsWDK.10.0.26100 --exact --silent `
--accept-package-agreements --accept-source-agreements --disable-interactivity
$kitRoot = $defaultKitRoot
$sdkVersion = Find-UsableSdkVersion $kitRoot
}
Expand All @@ -86,7 +87,8 @@ jobs:
if ([string]::IsNullOrWhiteSpace($version)) {
$version = '${{ github.ref_name }}'
}
$semverPattern = '^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$'
$semverPattern = '^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)' +
'(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$'
if ($version -notmatch $semverPattern) {
throw "Release version must be a v-prefixed semantic version tag: $version"
}
Expand Down Expand Up @@ -178,8 +180,11 @@ jobs:
run: |
$ErrorActionPreference = 'Stop'

$kitsRoot = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots' -Name KitsRoot10).KitsRoot10
$signtool = Get-ChildItem -LiteralPath (Join-Path $kitsRoot 'bin') -Recurse -Filter signtool.exe -File -ErrorAction SilentlyContinue |
$installedRoots = 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots'
$kitsRoot = (Get-ItemProperty -Path $installedRoots -Name KitsRoot10).KitsRoot10
$kitsBin = Join-Path $kitsRoot 'bin'
$signtool = Get-ChildItem -LiteralPath $kitsBin -Recurse -Filter signtool.exe -File `
-ErrorAction SilentlyContinue |
Sort-Object -Property FullName -Descending |
Select-Object -First 1
if (-not $signtool) {
Expand All @@ -189,11 +194,12 @@ jobs:
# The catalog is generated under the per-config package directory
# (e.g. .../windows_driver/Release/driver-package/), so locate it by
# search rather than a fixed path that breaks when the layout changes.
$catalogFile = Get-ChildItem -Path 'build-driver/src/driver/windows_driver' -Recurse -Filter 'sunshinevirtualdisplaydriver.cat' -File |
$driverBuild = 'build-driver/src/driver/windows_driver'
$catalogFile = Get-ChildItem -Path $driverBuild -Recurse -Filter 'sunshinevirtualdisplaydriver.cat' -File |
Sort-Object -Property LastWriteTime -Descending |
Select-Object -First 1
if (-not $catalogFile) {
throw 'Driver catalog sunshinevirtualdisplaydriver.cat was not found under build-driver/src/driver/windows_driver.'
throw "Driver catalog sunshinevirtualdisplaydriver.cat was not found under $driverBuild."
}
$catalog = $catalogFile.FullName
& $signtool.FullName sign /fd SHA256 /sha1 '${{ steps.signing_cert.outputs.thumbprint }}' $catalog
Expand All @@ -204,7 +210,8 @@ jobs:
$verifyOutput = & $signtool.FullName verify /pa $catalog 2>&1
$verifyExitCode = $LASTEXITCODE
$verifyText = ($verifyOutput | ForEach-Object { [string]$_ }) -join "`n"
if ($verifyExitCode -ne 0 -and $verifyText -notmatch 'terminated in a root\s+certificate which is not trusted') {
$untrustedRoot = 'terminated in a root\s+certificate which is not trusted'
if ($verifyExitCode -ne 0 -and $verifyText -notmatch $untrustedRoot) {
throw "signtool verify failed with exit code $verifyExitCode`n$verifyText"
}
$verifyText
Expand Down Expand Up @@ -235,7 +242,8 @@ jobs:
throw 'Release package driver directory was not found.'
}

Copy-Item -LiteralPath '${{ steps.signing_cert.outputs.cert_path }}' -Destination (Join-Path $driverDirectory.FullName 'SunshineVirtualDisplayDriver.cer') -Force
$certificate = Join-Path $driverDirectory.FullName 'SunshineVirtualDisplayDriver.cer'
Copy-Item -LiteralPath '${{ steps.signing_cert.outputs.cert_path }}' -Destination $certificate -Force
Remove-Item -LiteralPath $package[0].FullName -Force
Compress-Archive -Path (Join-Path $extractRoot '*') -DestinationPath $package[0].FullName -Force

Expand All @@ -262,7 +270,8 @@ jobs:
}
driver_catalog = 'self-signed'
}
$evidencePath = Join-Path 'build-driver' "libvirtualdisplay-${{ steps.version.outputs.package_version }}-evidence.json"
$evidenceFile = "libvirtualdisplay-${{ steps.version.outputs.package_version }}-evidence.json"
$evidencePath = Join-Path 'build-driver' $evidenceFile
$evidence | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath $evidencePath -Encoding utf8

$releaseNotesPath = Join-Path 'build-driver' 'release-notes.md'
Expand Down
Loading