@@ -118,11 +118,79 @@ jobs:
118118 -DENABLE_INSTALL_BDEPS=ON
119119 cmake --build cmake-build-frontend-sdl2 --parallel
120120
121+ - name : Import Code Signing Certificates
122+ env :
123+ MACOS_CERTIFICATE_APPLICATION : ${{ secrets.MACOS_CERTIFICATE_APPLICATION }}
124+ MACOS_CERTIFICATE_INSTALLER : ${{ secrets.MACOS_CERTIFICATE_INSTALLER }}
125+ MACOS_CERTIFICATE_PASSWORD : ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
126+ run : |
127+ echo "$MACOS_CERTIFICATE_APPLICATION" | base64 --decode > app_cert.p12
128+ echo "$MACOS_CERTIFICATE_INSTALLER" | base64 --decode > installer_cert.p12
129+
130+ KEYCHAIN_PASSWORD=$(openssl rand -base64 32)
131+ security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
132+ security default-keychain -s build.keychain
133+ security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
134+
135+ security import app_cert.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
136+ security import installer_cert.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/productsign
137+
138+ security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
139+
140+ rm app_cert.p12 installer_cert.p12
141+
142+ - name : Sign Application Bundle
143+ run : |
144+ APP_PATH="cmake-build-frontend-sdl2/projectM.app"
145+ IDENTITY="Developer ID Application: Mischa Spiegelmock (5926VBQM6Y)"
146+
147+ find "$APP_PATH/Contents/PlugIns" -name "*.dylib" -exec \
148+ codesign --force --options runtime --sign "$IDENTITY" {} \;
149+
150+ codesign --force --options runtime --sign "$IDENTITY" \
151+ "$APP_PATH/Contents/MacOS/projectMSDL"
152+
153+ codesign --force --options runtime --sign "$IDENTITY" "$APP_PATH"
154+
155+ codesign --verify --deep --strict "$APP_PATH"
156+
157+ - name : Notarize Application
158+ env :
159+ APPLE_ID : ${{ secrets.MACOS_NOTARIZATION_APPLE_ID }}
160+ APPLE_PASSWORD : ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
161+ run : |
162+ xcrun notarytool store-credentials "notary-profile" \
163+ --apple-id "$APPLE_ID" \
164+ --password "$APPLE_PASSWORD" \
165+ --team-id "5926VBQM6Y"
166+
167+ ditto -c -k --keepParent \
168+ "cmake-build-frontend-sdl2/projectM.app" \
169+ "projectM-notarize.zip"
170+
171+ xcrun notarytool submit "projectM-notarize.zip" \
172+ --keychain-profile "notary-profile" \
173+ --wait
174+
175+ xcrun stapler staple "cmake-build-frontend-sdl2/projectM.app"
176+
121177 - name : Package projectMSDL
178+ env :
179+ CODESIGN_IDENTITY_INSTALLER : " Developer ID Installer: Mischa Spiegelmock (5926VBQM6Y)"
122180 run : |
123181 cd cmake-build-frontend-sdl2
124182 cpack -G productbuild
125183
184+ - name : Notarize Package
185+ run : |
186+ PKG_FILE=$(ls cmake-build-frontend-sdl2/*.pkg | head -1)
187+
188+ xcrun notarytool submit "$PKG_FILE" \
189+ --keychain-profile "notary-profile" \
190+ --wait
191+
192+ xcrun stapler staple "$PKG_FILE"
193+
126194 - name : Upload Artifact
127195 uses : actions/upload-artifact@v4
128196 with :
0 commit comments