diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ff05a6..4f23fde 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -205,7 +205,9 @@ jobs: if [ -n "$SIGN_IDENTITY" ]; then echo "Signing application bundle with: $SIGN_IDENTITY" - codesign --force --deep --options runtime --timestamp=none \ + # --timestamp adds the RFC 3161 secure timestamp Apple notarization + # requires; --timestamp=none made the submission Invalid (1.0.2/1.0.3). + codesign --force --deep --options runtime --timestamp \ --sign "$SIGN_IDENTITY" \ build/Build/Products/Release/${{ env.PROJECT_NAME }}.app else @@ -265,12 +267,28 @@ jobs: ditto -c -k --keepParent "$APP_PATH" "$ZIP_PATH" echo "Submitting to Apple notarization service..." + SUBMIT_LOG="$RUNNER_TEMP/notary-submit.log" xcrun notarytool submit "$ZIP_PATH" \ --apple-id "$APPLE_ID" \ --password "$APPLE_APP_SPECIFIC_PASSWORD" \ --team-id "$APPLE_TEAM_ID" \ --wait \ - --timeout 30m + --timeout 30m 2>&1 | tee "$SUBMIT_LOG" + + # notarytool exits 0 even for status: Invalid — surface the rejection + # and Apple's issue list instead of failing later at stapler with 65. + if grep -q "status: Invalid" "$SUBMIT_LOG"; then + SUBMIT_ID=$(grep -oE 'id: [0-9a-f-]{36}' "$SUBMIT_LOG" | head -1 | awk '{print $2}') + echo "Notarization Invalid. Fetching Apple's issues for submission ${SUBMIT_ID:-}..." + if [ -n "$SUBMIT_ID" ]; then + xcrun notarytool log "$SUBMIT_ID" \ + --apple-id "$APPLE_ID" \ + --password "$APPLE_APP_SPECIFIC_PASSWORD" \ + --team-id "$APPLE_TEAM_ID" || true + fi + echo "##[error]Apple notarization rejected the submission" + exit 1 + fi echo "Stapling notarization ticket to app..." xcrun stapler staple "$APP_PATH" diff --git a/TransFrame.xcodeproj/project.pbxproj b/TransFrame.xcodeproj/project.pbxproj index d6211e1..0e2a681 100644 --- a/TransFrame.xcodeproj/project.pbxproj +++ b/TransFrame.xcodeproj/project.pbxproj @@ -223,7 +223,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -euo pipefail\n# Thin and sign embedded frameworks\nFRAMEWORKS_DIR=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Frameworks\"\nif [ -d \"$FRAMEWORKS_DIR\" ]; then\n TARGET_ARCH=\"${ARCHS:-arm64}\"\n if [ \"$TARGET_ARCH\" = \"arm64\" ] || [ \"$TARGET_ARCH\" = \"x86_64\" ]; then\n if [ -d \"$FRAMEWORKS_DIR/Sparkle.framework\" ]; then\n SPARKLE=\"$FRAMEWORKS_DIR/Sparkle.framework\"\n for b in \"Versions/B/Sparkle\" \"Versions/B/Autoupdate\" \"Versions/B/Updater.app/Contents/MacOS/Updater\" \"Versions/B/XPCServices/Downloader.xpc/Contents/MacOS/Downloader\" \"Versions/B/XPCServices/Installer.xpc/Contents/MacOS/Installer\"; do\n if [ -f \"$SPARKLE/$b\" ]; then\n lipo -thin \"$TARGET_ARCH\" \"$SPARKLE/$b\" -output \"$SPARKLE/$b.thin\" 2>/dev/null && mv \"$SPARKLE/$b.thin\" \"$SPARKLE/$b\" || true\n strip -x \"$SPARKLE/$b\" 2>/dev/null || true\n fi\n done\n fi\n fi\n SIGN_ID=\"${EXPANDED_CODE_SIGN_IDENTITY:-}\"\n if [ -z \"$SIGN_ID\" ] || [ \"$SIGN_ID\" = \"-\" ]; then\n SIGN_ID=$(security find-identity -v -p codesigning | grep -m1 \"Developer ID Application\" | awk -F '\"' '{print $2}' || true)\n fi\n if [ -z \"$SIGN_ID\" ]; then\n SIGN_ID=\"-\"\n fi\n for FRAMEWORK in \"$FRAMEWORKS_DIR\"/*.framework; do\n if [ -d \"$FRAMEWORK\" ]; then\n echo \"Re-signing framework with $SIGN_ID: $(basename \"$FRAMEWORK\")\"\n codesign --force --sign \"$SIGN_ID\" --timestamp=none --deep \"$FRAMEWORK\"\n fi\n done\nfi\nmkdir -p \"${DERIVED_FILE_DIR}\"\ntouch \"${DERIVED_FILE_DIR}/TransFrameFrameworkResign.stamp\"\n"; + shellScript = "set -euo pipefail\n# Thin and sign embedded frameworks\nFRAMEWORKS_DIR=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Frameworks\"\nif [ -d \"$FRAMEWORKS_DIR\" ]; then\n TARGET_ARCH=\"${ARCHS:-arm64}\"\n if [ \"$TARGET_ARCH\" = \"arm64\" ] || [ \"$TARGET_ARCH\" = \"x86_64\" ]; then\n if [ -d \"$FRAMEWORKS_DIR/Sparkle.framework\" ]; then\n SPARKLE=\"$FRAMEWORKS_DIR/Sparkle.framework\"\n for b in \"Versions/B/Sparkle\" \"Versions/B/Autoupdate\" \"Versions/B/Updater.app/Contents/MacOS/Updater\" \"Versions/B/XPCServices/Downloader.xpc/Contents/MacOS/Downloader\" \"Versions/B/XPCServices/Installer.xpc/Contents/MacOS/Installer\"; do\n if [ -f \"$SPARKLE/$b\" ]; then\n lipo -thin \"$TARGET_ARCH\" \"$SPARKLE/$b\" -output \"$SPARKLE/$b.thin\" 2>/dev/null && mv \"$SPARKLE/$b.thin\" \"$SPARKLE/$b\" || true\n strip -x \"$SPARKLE/$b\" 2>/dev/null || true\n fi\n done\n fi\n fi\n SIGN_ID=\"${EXPANDED_CODE_SIGN_IDENTITY:-}\"\n if [ -z \"$SIGN_ID\" ] || [ \"$SIGN_ID\" = \"-\" ]; then\n SIGN_ID=$(security find-identity -v -p codesigning | grep -m1 \"Developer ID Application\" | awk -F '\"' '{print $2}' || true)\n fi\n if [ -z \"$SIGN_ID\" ]; then\n SIGN_ID=\"-\"\n fi\n for FRAMEWORK in \"$FRAMEWORKS_DIR\"/*.framework; do\n if [ -d \"$FRAMEWORK\" ]; then\n echo \"Re-signing framework with $SIGN_ID: $(basename \"$FRAMEWORK\")\"\n codesign --force --sign \"$SIGN_ID\" --timestamp --deep \"$FRAMEWORK\"\n fi\n done\nfi\nmkdir -p \"${DERIVED_FILE_DIR}\"\ntouch \"${DERIVED_FILE_DIR}/TransFrameFrameworkResign.stamp\"\n"; }; /* End PBXShellScriptBuildPhase section */