Skip to content

Commit 8ed03ee

Browse files
author
David Imongirie
committed
ci: add optional signing and release attach artifacts
1 parent eb07e87 commit 8ed03ee

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/windows_build.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,33 @@ jobs:
5454
with:
5555
name: TestBuddy-installer
5656
path: TestBuddy-Setup.exe
57+
58+
- name: Optional: Sign artifacts (if PFX secret provided)
59+
if: ${{ secrets.SIGN_CERT_PFX != '' && secrets.SIGN_CERT_PASSWORD != '' }}
60+
shell: powershell
61+
run: |
62+
Write-Host "Writing PFX to file and attempting to sign artifacts..."
63+
$pfxBase64 = '${{ secrets.SIGN_CERT_PFX }}'
64+
[IO.File]::WriteAllBytes('cert.pfx', [Convert]::FromBase64String($pfxBase64))
65+
choco install osslsigncode -y || Write-Host 'osslsigncode install may have failed'
66+
if (Test-Path .\dist\TestBuddy.exe) {
67+
Write-Host 'Signing dist\\TestBuddy.exe'
68+
osslsigncode sign -pkcs12 cert.pfx -pass '${{ secrets.SIGN_CERT_PASSWORD }}' -n 'TestBuddy' -i 'http://testbuddy.local' -t 'http://timestamp.digicert.com' -in .\dist\TestBuddy.exe -out .\dist\TestBuddy-signed.exe || Write-Host 'Signing EXE failed'
69+
}
70+
if (Test-Path .\TestBuddy-Setup.exe) {
71+
Write-Host 'Signing TestBuddy-Setup.exe'
72+
osslsigncode sign -pkcs12 cert.pfx -pass '${{ secrets.SIGN_CERT_PASSWORD }}' -n 'TestBuddy' -i 'http://testbuddy.local' -t 'http://timestamp.digicert.com' -in .\TestBuddy-Setup.exe -out .\TestBuddy-Setup-signed.exe || Write-Host 'Signing installer failed'
73+
}
74+
75+
- name: Create GitHub release and attach artifacts
76+
uses: ncipollo/release-action@v1
77+
with:
78+
tag: build-${{ github.run_number }}
79+
name: TestBuddy build ${{ github.run_number }}
80+
body: |
81+
Automated build from commit ${{ github.sha }}
82+
- Runner: ${{ runner.os }}
83+
- Workflow: ${{ github.workflow }}
84+
files: |
85+
dist/TestBuddy*.exe
86+
TestBuddy-Setup*.exe

0 commit comments

Comments
 (0)