3030 uses : actions/setup-java@v5
3131 with :
3232 java-version : " 23"
33- distribution : " temurin"
33+ distribution : ${{ runner.os == 'Windows' && 'zulu' || ' temurin' }} # zulu only for Windows to enable signing MSI contents
3434
3535 - name : Setup Gradle
3636 uses : gradle/actions/setup-gradle@v6
@@ -43,14 +43,57 @@ jobs:
4343 test -n "$version"
4444 echo "pretixVersion=$version" >> "$GITHUB_ENV"
4545
46- - name : Package App
46+ - name : (macOS, Linux) package app
47+ if : runner.os != 'Windows'
4748 working-directory : ./pretixscan
4849 shell : bash
49- run : ./gradlew packageDistributionForCurrentOS -PappPackageName="${{ runner.os == 'Windows' && ' pretixSCAN Desktop' || 'pretixSCAN' }} "
50+ run : ./gradlew packageDistributionForCurrentOS -PappPackageName="pretixSCAN"
5051
51- # Only sign on releases to stay within the monthly signature quota
52- - name : Sign Windows Installer
53- if : matrix.os == 'windows-latest' && github.event_name == 'release'
52+ # Windows: the app image is built first so its binaries can be signed before they are packaged into the MSI
53+ - name : (Windows) create application image
54+ if : runner.os == 'Windows'
55+ working-directory : ./pretixscan
56+ shell : bash
57+ run : ./gradlew :composeApp:createDistributable -PappPackageName="pretixSCAN Desktop"
58+
59+ - name : (Windows) copy application image for signing
60+ if : runner.os == 'Windows'
61+ working-directory : ./pretixscan
62+ shell : bash
63+ run : |
64+ rm -rf composeApp/build/signing
65+ mkdir -p composeApp/build/signing/app
66+ cp -R "composeApp/build/compose/binaries/main/app/pretixSCAN Desktop" composeApp/build/signing/app/
67+ chmod -R u+w "composeApp/build/signing/app/pretixSCAN Desktop"
68+ test -f "composeApp/build/signing/app/pretixSCAN Desktop/pretixSCAN Desktop.exe"
69+ test -f "composeApp/build/signing/app/pretixSCAN Desktop/app/.jpackage.xml"
70+
71+ - name : (Windows) sign application binaries
72+ if : runner.os == 'Windows' # && github.event_name == 'release'
73+ uses : azure/artifact-signing-action@v2
74+ with :
75+ azure-tenant-id : ${{ secrets.AZURE_TENANT_ID }}
76+ azure-client-id : ${{ secrets.AZURE_CLIENT_ID }}
77+ azure-client-secret : ${{ secrets.AZURE_CLIENT_SECRET }}
78+ endpoint : https://neu.codesigning.azure.net/
79+ signing-account-name : pretix
80+ certificate-profile-name : pretix
81+ files-folder : ${{ github.workspace }}\pretixscan\composeApp\build\signing\app\pretixSCAN Desktop
82+ files-folder-filter : exe,dll
83+ files-folder-recurse : true
84+ file-digest : SHA256
85+ timestamp-rfc3161 : http://timestamp.acs.microsoft.com
86+ timestamp-digest : SHA256
87+ exclude-azure-cli-credential : true
88+
89+ - name : (Windows) build installer
90+ if : runner.os == 'Windows'
91+ working-directory : ./pretixscan
92+ shell : bash
93+ run : ./gradlew :composeApp:packageMsi -PappPackageName="pretixSCAN Desktop" -PappImageDir="${{ github.workspace }}\pretixscan\composeApp\build\signing\app\pretixSCAN Desktop"
94+
95+ - name : (Windows) sign installer
96+ if : runner.os == 'Windows' # && github.event_name == 'release'
5497 uses : azure/artifact-signing-action@v2
5598 with :
5699 azure-tenant-id : ${{ secrets.AZURE_TENANT_ID }}
0 commit comments