Skip to content

Commit a919f8f

Browse files
committed
Fix ugh
1 parent 5d2d8c9 commit a919f8f

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/dotnet-desktop.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,31 @@ jobs:
127127
# --------------------------------------------
128128
# Decode signing cert
129129
# --------------------------------------------
130+
- name: Locate signtool.exe
131+
shell: pwsh
132+
run: |
133+
$candidates = @()
134+
$kitsRoot = "${env:ProgramFiles(x86)}\Windows Kits\10\bin"
135+
if (Test-Path $kitsRoot) {
136+
$candidates += Get-ChildItem -Path $kitsRoot -Recurse -Filter signtool.exe -ErrorAction SilentlyContinue
137+
}
138+
$candidates += Get-ChildItem -Path "${env:ProgramFiles(x86)}\Microsoft SDKs" -Recurse -Filter signtool.exe -ErrorAction SilentlyContinue
139+
140+
$signtool = $candidates |
141+
Sort-Object FullName -Descending |
142+
Select-Object -First 1
143+
144+
if (-not $signtool) {
145+
Write-Error "signtool.exe not found on runner."
146+
exit 1
147+
}
148+
149+
Write-Host "Found signtool: $($signtool.FullName)"
150+
Add-Content -Path $env:GITHUB_PATH -Value $signtool.Directory.FullName
151+
signtool /?
152+
130153
- name: Decode code signing certificate
154+
shell: pwsh
131155
run: |
132156
$bytes = [Convert]::FromBase64String("${{ secrets.CODESIGN_PFX }}")
133157
[IO.File]::WriteAllBytes("codesign.pfx", $bytes)

0 commit comments

Comments
 (0)