Skip to content

Commit 4086e4b

Browse files
committed
use ps1 file
1 parent 5e646f2 commit 4086e4b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,27 @@ jobs:
119119
}
120120
$metadata | ConvertTo-Json | Out-File -FilePath "metadata.json" -Encoding utf8
121121
122+
- name: Create signing script
123+
shell: pwsh
124+
run: |
125+
$script = @'
126+
$env:AZURE_TENANT_ID = "${{ secrets.DECO_SIGN_AZURE_TENANT_ID }}"
127+
$env:AZURE_CLIENT_ID = "${{ secrets.DECO_SIGN_AZURE_CLIENT_ID }}"
128+
$env:AZURE_CLIENT_SECRET = "${{ secrets.DECO_SIGN_AZURE_CLIENT_SECRET }}"
129+
130+
$filePath = $args[0]
131+
Write-Host "Signing: $filePath"
132+
133+
& signtool sign /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 /dlib Azure.CodeSigning.Dlib.dll /dmdf metadata.json "$filePath"
134+
135+
if ($LASTEXITCODE -ne 0) {
136+
Write-Error "Signing failed with exit code $LASTEXITCODE"
137+
exit $LASTEXITCODE
138+
}
139+
'@
140+
141+
$script | Out-File -FilePath "sign.ps1" -Encoding utf8
142+
122143
- name: Run GoReleaser for Windows
123144
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
124145
with:

.goreleaser-windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ builds:
4141

4242
hooks:
4343
post:
44-
- pwsh -Command "signtool sign /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 /dlib Azure.CodeSigning.Dlib.dll /dmdf metadata.json '{{ .Path }}'"
44+
- pwsh -File sign.ps1 "{{ .Path }}"
4545

4646
archives:
4747
- formats: ["zip"]

0 commit comments

Comments
 (0)