Skip to content

Commit 67d512b

Browse files
committed
📌 **Sign & Notarize macOS Build in GitHub Actions** (#164) [ci]
- Implemented Code Signing using `Developer ID Application: Dimitris Kalamaras (K89VSL4N97)`. - Added Notarization using `notarytool` with Apple ID credentials (since API-based notarization is not available for Individual accounts). - Fixed build process order - Notarization happens before renaming the `.dmg` - Stapling happens after renaming, ensuring notarization remains valid. - Improved logging & verification steps (`lipo`, `otool -L`, `PkgInfo`). - Stored credentials in GitHub Secrets 🎉 **Now, SocNetV macOS CI/CD builds are fully signed & notarized!** No more "damaged app" errors from Gatekeeper. 🚀 Closes #164.
1 parent a9eed14 commit 67d512b

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

.github/workflows/build-ci.yml

+31-1
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,29 @@ jobs:
527527
echo "✅ PkgInfo has been successfully created."
528528
fi
529529
530+
531+
echo "${{ secrets.MACOS_CERTIFICATE }}" | base64 --decode > certificate.p12
532+
security create-keychain -p "" build.keychain
533+
security default-keychain -s build.keychain
534+
security unlock-keychain -p "" build.keychain
535+
security import certificate.p12 -k build.keychain -P "${{ secrets.MACOS_CERTIFICATE_PASSWORD }}" -T /usr/bin/codesign
536+
security set-key-partition-list -S apple-tool:,apple: -k "" build.keychain
537+
rm -f certificate.p12
538+
539+
echo "🔏 Sign SocNetV.app"
540+
codesign --deep --force --verbose \
541+
--options runtime \
542+
--entitlements scripts/entitlements.plist \
543+
--sign "Developer ID Application: Dimitris Kalamaras (K89VSL4N97)" \
544+
"${{env.APP_NAME}}.app"
545+
546+
echo "🛠️ Store Apple ID Credentials for Notarization"
547+
xcrun notarytool store-credentials "AC_PASSWORD" \
548+
--apple-id "${{ secrets.AC_APPLE_ID }}" \
549+
--team-id "${{ secrets.AC_TEAM_ID }}" \
550+
--password "${{ secrets.AC_PASSWORD }}"
551+
552+
530553
# Run macdeployqt to bundle the app
531554
echo "🚀 Running macdeployqt to create macOS bundle..."
532555
macdeployqt "${{env.APP_NAME}}.app" -dmg -verbose=3 || {
@@ -543,8 +566,11 @@ jobs:
543566
exit 1
544567
fi
545568
569+
echo "📜 Notarize the DMG"
570+
xcrun notarytool submit ${{env.APP_NAME}}.dmg \
571+
--keychain-profile "AC_PASSWORD" --wait
546572
547-
# Rename DMG file
573+
# Rename DMG file **AFTER** notarization
548574
if [[ -f ${{env.APP_NAME}}.dmg ]]; then
549575
DMG_NAME="${{env.APP_NAME}}-${{env.VERSION}}.dmg"
550576
mv "${{env.APP_NAME}}.dmg" "${DMG_NAME}"
@@ -557,6 +583,10 @@ jobs:
557583
exit 1
558584
fi
559585
586+
# Staple notarization **AFTER RENAMING** ✅
587+
echo "📌 Staple Notarization"
588+
xcrun stapler staple "${DMG_NAME}"
589+
560590
- if: contains( matrix.os, 'macos') && matrix.qt-version == '6.8.0' && env.MAC_ARTIFACT != ''
561591
name: 📤 Upload ${{matrix.os}} build artifacts of ${{env.APP_NAME}} ${{ env.VERSION }} to GitHub ${{ env.UPLOAD_URL }}
562592
run: |

0 commit comments

Comments
 (0)