Skip to content

Commit 747ca49

Browse files
fix(ci): replace broken choco windows-sdk-10.1 with winget fallback
The windows-sdk-10.1 Chocolatey package fails with a side-by-side configuration error on the self-hosted runner. Check for an existing signtool first, then fall back to winget with a current SDK version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5d8845c commit 747ca49

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,24 @@ jobs:
228228
- name: Install Windows SDK (signtool)
229229
shell: pwsh
230230
run: |
231-
choco install windows-sdk-10.1 -y
231+
# Find existing signtool first; install SDK only if missing
232232
$signtool = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits\10\bin" `
233-
-Recurse -Filter signtool.exe | Where-Object { $_.FullName -match '\\x64\\' } `
233+
-Recurse -Filter signtool.exe -ErrorAction SilentlyContinue `
234+
| Where-Object { $_.FullName -match '\\x64\\' } `
234235
| Sort-Object { [version]($_.FullName -replace '.*\\(\d+\.\d+\.\d+\.\d+)\\.*','$1') } `
235236
| Select-Object -Last 1 -ExpandProperty FullName
237+
238+
if (-not $signtool) {
239+
Write-Host "signtool not found, installing Windows SDK via winget..."
240+
winget install --id Microsoft.WindowsSDK.10.0.26100 --silent --accept-source-agreements --accept-package-agreements
241+
$signtool = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits\10\bin" `
242+
-Recurse -Filter signtool.exe | Where-Object { $_.FullName -match '\\x64\\' } `
243+
| Sort-Object { [version]($_.FullName -replace '.*\\(\d+\.\d+\.\d+\.\d+)\\.*','$1') } `
244+
| Select-Object -Last 1 -ExpandProperty FullName
245+
}
246+
247+
if (-not $signtool) { throw "signtool.exe not found after SDK install" }
248+
Write-Host "Using signtool: $signtool"
236249
echo "SIGNTOOL_PATH=$signtool" >> $env:GITHUB_ENV
237250
238251
- name: Generate self-signed code signing certificate

0 commit comments

Comments
 (0)