forked from cli/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsign.ps1
More file actions
22 lines (17 loc) · 737 Bytes
/
Copy pathsign.ps1
File metadata and controls
22 lines (17 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env pwsh
if ($null -eq $Env:DO_SIGN_ARTIFACTS -or $Env:DO_SIGN_ARTIFACTS -eq "false") {
Write-Host "Skipping Windows code signing; DO_SIGN_ARTIFACTS not set or false"
exit
}
if ($null -eq $Env:DLIB_PATH) {
Write-Host "Skipping Windows code signing; DLIB_PATH not set"
exit
}
if ($null -eq $Env:METADATA_PATH) {
Write-Host "Skipping Windows code signing; METADATA_PATH not set"
exit
}
$signtool = Resolve-Path "C:\Program Files (x86)\Windows Kits\10\bin\*\x64\signtool.exe" | Select-Object -Last 1
Write-Host "Using signtool from $signtool"
& $signtool sign /d "GitHub CLI" /fd sha256 /td sha256 /tr http://timestamp.acs.microsoft.com /v /dlib "$Env:DLIB_PATH" /dmdf "$Env:METADATA_PATH" $Args[0]
exit $LASTEXITCODE