diff --git a/.gitea/actions/macos-notarize/action.yml b/.gitea/actions/macos-notarize/action.yml index 554319df..ccc7b63a 100644 --- a/.gitea/actions/macos-notarize/action.yml +++ b/.gitea/actions/macos-notarize/action.yml @@ -244,17 +244,33 @@ runs: ditto -c -k --keepParent "${{ inputs.app-path }}" "$ZIP_PATH" echo "Submitting for notarization with API key..." - xcrun notarytool submit "$ZIP_PATH" \ + # Capture output and exit status of notarization + NOTARY_OUTPUT=$(xcrun notarytool submit "$ZIP_PATH" \ --key ~/private_keys/AuthKey_${API_KEY_ID}.p8 \ --key-id "$API_KEY_ID" \ --issuer "$API_ISSUER_ID" \ - --wait + --wait 2>&1) + NOTARY_STATUS=$? + + # Display output for debugging + echo "Notarization command output:" + echo "$NOTARY_OUTPUT" + echo "Notarization exit status: $NOTARY_STATUS" + + # Enhanced check for notarization success + if [ $NOTARY_STATUS -eq 0 ] && echo "$NOTARY_OUTPUT" | grep -q -E "success|accepted"; then + echo "✅ Notarization completed successfully!" - # Check if notarization succeeded - if [ $? -eq 0 ]; then # Staple the notarization ticket echo "Stapling notarization ticket..." xcrun stapler staple "${{ inputs.app-path }}" + STAPLE_STATUS=$? + + if [ $STAPLE_STATUS -eq 0 ]; then + echo "✅ Stapling completed successfully!" + else + echo "⚠️ Stapling completed with status $STAPLE_STATUS (may still be valid)" + fi # Verify notarization echo "🔍 Verifying notarization..." @@ -262,7 +278,8 @@ runs: echo "::set-output name=notarized::true" else - echo "❌ Notarization failed" + echo "❌ Notarization failed or did not complete properly" + echo "Please check the notarization logs for details" fi # Clean up @@ -277,17 +294,33 @@ runs: ditto -c -k --keepParent "${{ inputs.app-path }}" "$ZIP_PATH" echo "Submitting for notarization..." - xcrun notarytool submit "$ZIP_PATH" \ + # Capture output and exit status of notarization + NOTARY_OUTPUT=$(xcrun notarytool submit "$ZIP_PATH" \ --apple-id "$APPLE_ID" \ --password "$APP_PASSWORD" \ --team-id "$APPLE_TEAM_ID" \ - --wait + --wait 2>&1) + NOTARY_STATUS=$? - # Check if notarization succeeded - if [ $? -eq 0 ]; then + # Display output for debugging + echo "Notarization command output:" + echo "$NOTARY_OUTPUT" + echo "Notarization exit status: $NOTARY_STATUS" + + # Enhanced check for notarization success + if [ $NOTARY_STATUS -eq 0 ] && echo "$NOTARY_OUTPUT" | grep -q -E "success|accepted"; then + echo "✅ Notarization completed successfully!" + # Staple the notarization ticket echo "Stapling notarization ticket..." xcrun stapler staple "${{ inputs.app-path }}" + STAPLE_STATUS=$? + + if [ $STAPLE_STATUS -eq 0 ]; then + echo "✅ Stapling completed successfully!" + else + echo "⚠️ Stapling completed with status $STAPLE_STATUS (may still be valid)" + fi # Verify notarization echo "🔍 Verifying notarization..." @@ -295,7 +328,8 @@ runs: echo "::set-output name=notarized::true" else - echo "❌ Notarization failed" + echo "❌ Notarization failed or did not complete properly" + echo "Please check the notarization logs for details" fi else echo "⚠️ Missing notarization credentials. Skipping notarization." diff --git a/.gitea/workflows/test-macos-build.yml b/.gitea/workflows/test-macos-build.yml index d4a7602d..b30c5f90 100644 --- a/.gitea/workflows/test-macos-build.yml +++ b/.gitea/workflows/test-macos-build.yml @@ -111,7 +111,7 @@ jobs: with: name: LuckyWorld-macOS-Signed path: ${{ steps.sign-and-notarize.outputs.package-path }} - retention-days: 7 + retention-days: 30 # Report results - name: Report Results diff --git a/scripts/mac_build.sh b/scripts/mac_build.sh index af4b72fd..1dbad1a5 100755 --- a/scripts/mac_build.sh +++ b/scripts/mac_build.sh @@ -73,10 +73,8 @@ rm -rf DerivedDataCache Intermediate Binaries Saved # -skipiostore \ # -skippak \ (disable -pak and -iostore) - -# http://forums.unrealengine.com/t/code-signing-and-notarization-for-mac/146486 echo "" -echo "Build completed. Application path:" +echo "🦾 Build completed. Application path:" APP_PATH=$(find "$ARCHIVE_DIR" -name "*.app" -type d | head -n 1) echo "$APP_PATH"