@@ -537,58 +537,58 @@ jobs:
537
537
echo "⚠️ Found PkgInfo in root directory - removing it"
538
538
rm "${{env.APP_NAME}}.app/PkgInfo"
539
539
fi
540
-
540
+
541
541
# Ensure PkgInfo exists in the Contents directory
542
542
if [[ ! -f "${{env.APP_NAME}}.app/Contents/PkgInfo" ]]; then
543
543
echo "Creating PkgInfo in Contents directory"
544
544
echo "APPL????" > "${{env.APP_NAME}}.app/Contents/PkgInfo"
545
545
fi
546
-
546
+
547
547
# Clear extended attributes that could interfere with signing
548
548
find "${{env.APP_NAME}}.app" -type f -exec xattr -c {} \;
549
-
549
+
550
550
# First run macdeployqt WITHOUT creating DMG yet
551
551
echo "🚀 Running macdeployqt to bundle required libraries..."
552
552
macdeployqt "${{env.APP_NAME}}.app" -verbose=3 || {
553
553
echo "Error: macdeployqt failed."
554
554
exit 1
555
555
}
556
-
556
+
557
557
# Now sign the .app bundle AFTER macdeployqt has added all dependencies
558
558
echo "🔏 Sign the application bundle"
559
559
codesign --deep --force --verbose \
560
560
--options runtime \
561
561
--entitlements ../scripts/entitlements.plist \
562
562
--sign "Developer ID Application: Dimitris Kalamaras (${{ secrets.AC_TEAM_ID }})" \
563
563
"${{env.APP_NAME}}.app"
564
-
564
+
565
565
# Verify the signature
566
566
echo "🔍 Verifying signature..."
567
567
codesign --verify --verbose "${{env.APP_NAME}}.app"
568
-
568
+
569
569
# Create the DMG from the signed app
570
570
echo "📦 Creating DMG from signed application..."
571
571
hdiutil create -volname "${{env.APP_NAME}}" -srcfolder "${{env.APP_NAME}}.app" -ov -format UDZO "${{env.APP_NAME}}.dmg"
572
-
572
+
573
573
# Sign the DMG
574
574
echo "🔏 Signing the DMG..."
575
575
codesign --force --sign "Developer ID Application: Dimitris Kalamaras (${{ secrets.AC_TEAM_ID }})" "${{env.APP_NAME}}.dmg"
576
-
576
+
577
577
# Notarize the signed DMG
578
578
echo "📜 Notarize the DMG"
579
579
xcrun notarytool submit "${{env.APP_NAME}}.dmg" \
580
580
--keychain-profile "AC_PASSWORD" --wait
581
-
581
+
582
582
# Check the notarization status to handle success or failure
583
583
notarization_info=$(xcrun notarytool info --keychain-profile "AC_PASSWORD" "$(xcrun notarytool history --keychain-profile "AC_PASSWORD" | grep "${{env.APP_NAME}}.dmg" | head -1 | awk '{print $1}')")
584
-
584
+
585
585
if echo "$notarization_info" | grep -q "status: Accepted"; then
586
586
echo "✅ Notarization successful!"
587
-
587
+
588
588
# Staple the notarization ticket to the DMG
589
589
echo "📌 Stapling notarization ticket to DMG..."
590
590
xcrun stapler staple "${{env.APP_NAME}}.dmg"
591
-
591
+
592
592
# Rename DMG file after successful notarization and stapling
593
593
DMG_NAME="${{env.APP_NAME}}-${{env.VERSION}}.dmg"
594
594
mv "${{env.APP_NAME}}.dmg" "${DMG_NAME}"
@@ -598,12 +598,12 @@ jobs:
598
598
else
599
599
echo "❌ Notarization failed. Details:"
600
600
echo "$notarization_info"
601
-
601
+
602
602
# You might want to check for specific errors and provide guidance
603
603
if echo "$notarization_info" | grep -q "issues"; then
604
604
xcrun notarytool log --keychain-profile "AC_PASSWORD" "$(xcrun notarytool history --keychain-profile "AC_PASSWORD" | grep "${{env.APP_NAME}}.dmg" | head -1 | awk '{print $1}')"
605
605
fi
606
-
606
+
607
607
# Still create the artifact, but with a different name to indicate it's not notarized
608
608
DMG_NAME="${{env.APP_NAME}}-${{env.VERSION}}-unsigned.dmg"
609
609
mv "${{env.APP_NAME}}.dmg" "${DMG_NAME}"
0 commit comments