@@ -243,8 +243,6 @@ jobs:
243
243
Expand-Archive -Path ".\dist\k6-$env:VERSION-windows-amd64.zip" -DestinationPath .\packaging\
244
244
move .\packaging\k6-$env:VERSION-windows-amd64\k6.exe .\packaging\
245
245
rmdir .\packaging\k6-$env:VERSION-windows-amd64\
246
- - name : Add signtool to PATH
247
- run : echo "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.17763.0\x64" | Out-File -FilePath $env:GITHUB_PATH -Append
248
246
249
247
- name : Create the MSI package
250
248
run : |
@@ -255,7 +253,7 @@ jobs:
255
253
light.exe -ext WixUIExtension k6.wixobj
256
254
257
255
- name : Sign Windows binary and .msi package
258
- # GH secrets are unavaileble when building from project forks, so this
256
+ # GH secrets are unavailable when building from project forks, so this
259
257
# will fail for external PRs, even if we wanted to do it. And we don't.
260
258
# We are only going to sign packages that are built from master or a
261
259
# version tag, or manually triggered dev builds, so we have enough
@@ -266,11 +264,14 @@ jobs:
266
264
$bytes = [Convert]::FromBase64String("${{ secrets.WIN_SIGN_CERT }}")
267
265
[IO.File]::WriteAllBytes("k6.pfx", $bytes)
268
266
267
+ # Get the latest signtool executable
268
+ $SignTool = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits\10\bin" -Recurse -Filter signtool.exe | Where-Object { $_.DirectoryName -like "*\x64" } | Sort-Object -Descending | Select-Object -First 1
269
+
269
270
# Sign the Windows binary
270
- signtool sign /f k6.pfx /p "${{ secrets.WIN_SIGN_PASS }}" /tr "http://timestamp.digicert.com" /td sha256 /fd sha256 "packaging\k6.exe"
271
+ & $SignTool sign /f k6.pfx /p "${{ secrets.WIN_SIGN_PASS }}" /tr "http://timestamp.digicert.com" /td sha256 /fd sha256 "packaging\k6.exe"
271
272
272
273
# Sign the MSI package
273
- signtool sign /f k6.pfx /p "${{ secrets.WIN_SIGN_PASS }}" /tr "http://timestamp.digicert.com" /td sha256 /fd sha256 "packaging\k6.msi"
274
+ & $SignTool sign /f k6.pfx /p "${{ secrets.WIN_SIGN_PASS }}" /tr "http://timestamp.digicert.com" /td sha256 /fd sha256 "packaging\k6.msi"
274
275
275
276
# Cleanup signing artifacts
276
277
del k6.pfx
0 commit comments