Skip to content

Commit 26c3bf0

Browse files
authored
ci(app): electron builder Windows signing workaround (#18479)
<electron-userland/electron-builder#9076>
1 parent 2025151 commit 26c3bf0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/app-test-build-deploy.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,32 @@ jobs:
221221
run: |
222222
make -C app dist
223223
224+
- name: Install and Invoke TrustedSigning @0.5.3 on dummy executable
225+
# Work around from https://github.com/electron-userland/electron-builder/issues/9076#issuecomment-2855541018
226+
if: startsWith(matrix.os, 'windows') && contains(needs.determine-build-type.outputs.type, 'release')
227+
shell: pwsh
228+
run: |
229+
Install-Module -Name TrustedSigning -RequiredVersion 0.5.3 -Force -Repository PSGallery
230+
# Create a dummy executable file
231+
$dummyExePath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "dummy.exe"
232+
Set-Content -Path $dummyExePath -Value "This is a dummy executable for testing purposes."
233+
# Invoke Trusted Signing on the dummy executable
234+
# Necessary to force dependency resolution
235+
try {
236+
Invoke-TrustedSigning `
237+
-Endpoint 'https://eus.codesigning.azure.net/' `
238+
-CertificateProfileName 'dummyName' `
239+
-CodeSigningAccountName 'dummyName' `
240+
-TimestampRfc3161 'http://timestamp.acs.microsoft.com' `
241+
-TimestampDigest 'SHA256' `
242+
-FileDigest 'SHA256' `
243+
-Files $dummyExePath
244+
} catch {
245+
Write-Host "Invoke-TrustedSigning failed: $($_.Exception.Message)"
246+
# Prevent the script from exiting with a non-zero status
247+
exit 0
248+
}
249+
224250
# build the desktop app and deploy it
225251
- name: 'build ${{matrix.variant}} app for ${{ matrix.os }}'
226252
if: matrix.target == 'desktop'

0 commit comments

Comments
 (0)