fix(actions): enhance macOS build workflow by adding steps for creating and uploading stapled app archives and DMG files
All checks were successful
Test macOS Build Action / test-macos-build (push) Successful in 55m17s

This commit is contained in:
Ozgur 2025-04-15 18:07:29 +02:00
parent 2e0a1b8b60
commit cb44ddadab
No known key found for this signature in database
GPG Key ID: 66CDF27505A35546

View File

@ -280,15 +280,6 @@ jobs:
bundle-id: ${{ env.BUNDLE_ID }}
fallback-to-adhoc: 'false'
# Upload signed app if available
- name: Upload Signed App
uses: actions/upload-artifact@v3
if: steps.sign-and-notarize.outputs.signed != 'none'
with:
name: ${{ steps.sign-and-notarize.outputs.notarized == 'true' && 'LuckyWorld-macOS-Signed-Notarized' || 'LuckyWorld-macOS-Signed' }}
path: ${{ steps.sign-and-notarize.outputs.package-path }}
retention-days: 30
# Additional verification and stapling to ensure the app opens without warning
- name: Verify and Staple App
if: steps.sign-and-notarize.outputs.notarized == 'true' && steps.sign-and-notarize.outputs.signed != 'none'
@ -318,8 +309,84 @@ jobs:
fi
echo "✅ Verification and stapling completed!"
# Export STAPLED_APP_PATH for later use
echo "STAPLED_APP_PATH=$APP_PATH" >> "$GITHUB_ENV"
shell: bash
# Create a properly archived ZIP of the stapled app (preserves stapling)
- name: Create Stapled App Archive (ZIP)
if: steps.sign-and-notarize.outputs.notarized == 'true' && steps.sign-and-notarize.outputs.signed != 'none'
run: |
STAPLED_APP_PATH="${{ env.STAPLED_APP_PATH }}"
APP_NAME=$(basename "$STAPLED_APP_PATH" .app)
ARCHIVE_DIR="./ArchivedApps"
mkdir -p "$ARCHIVE_DIR"
# Create the ZIP archive (preserving all metadata)
echo "Creating ZIP archive of stapled app..."
cd "$(dirname "$STAPLED_APP_PATH")"
# Use ditto to preserve all metadata and permissions
ditto -c -k --keepParent "$(basename "$STAPLED_APP_PATH")" "$GITHUB_WORKSPACE/$ARCHIVE_DIR/$APP_NAME.zip"
cd "$GITHUB_WORKSPACE"
echo "ZIP archive created at: $ARCHIVE_DIR/$APP_NAME.zip"
echo "STAPLED_APP_ZIP=$ARCHIVE_DIR/$APP_NAME.zip" >> "$GITHUB_ENV"
shell: bash
# Create a DMG file (macOS disk image) for easy distribution
- name: Create DMG for Distribution
if: steps.sign-and-notarize.outputs.notarized == 'true' && steps.sign-and-notarize.outputs.signed != 'none'
run: |
STAPLED_APP_PATH="${{ env.STAPLED_APP_PATH }}"
APP_NAME=$(basename "$STAPLED_APP_PATH" .app)
ARCHIVE_DIR="./ArchivedApps"
DMG_FILE="$ARCHIVE_DIR/$APP_NAME.dmg"
# Create a DMG file
echo "Creating DMG file..."
hdiutil create -volname "$APP_NAME" -srcfolder "$STAPLED_APP_PATH" -ov -format UDZO "$DMG_FILE"
echo "DMG file created at: $DMG_FILE"
echo "STAPLED_APP_DMG=$DMG_FILE" >> "$GITHUB_ENV"
shell: bash
# Upload stapled app directly (this is the most reliable approach)
- name: Upload Stapled App Bundle
uses: actions/upload-artifact@v3
if: steps.sign-and-notarize.outputs.notarized == 'true' && steps.sign-and-notarize.outputs.signed != 'none'
with:
name: LuckyWorld-macOS-Stapled-App-Bundle
path: ${{ env.STAPLED_APP_PATH }}
retention-days: 30
# Upload the ZIP archive (proper archiving that preserves stapling)
- name: Upload Stapled App ZIP Archive
uses: actions/upload-artifact@v3
if: steps.sign-and-notarize.outputs.notarized == 'true' && steps.sign-and-notarize.outputs.signed != 'none'
with:
name: LuckyWorld-macOS-Stapled-ZIP
path: ${{ env.STAPLED_APP_ZIP }}
retention-days: 30
# Upload the DMG file
- name: Upload Stapled App DMG
uses: actions/upload-artifact@v3
if: steps.sign-and-notarize.outputs.notarized == 'true' && steps.sign-and-notarize.outputs.signed != 'none'
with:
name: LuckyWorld-macOS-Stapled-DMG
path: ${{ env.STAPLED_APP_DMG }}
retention-days: 30
# Upload signed app (might be DMG or other package format)
- name: Upload Signed App Package
uses: actions/upload-artifact@v3
if: steps.sign-and-notarize.outputs.signed != 'none'
with:
name: ${{ steps.sign-and-notarize.outputs.notarized == 'true' && 'LuckyWorld-macOS-Signed-Notarized-Package' || 'LuckyWorld-macOS-Signed-Package' }}
path: ${{ steps.sign-and-notarize.outputs.package-path }}
retention-days: 30
# Upload ZIP package if DMG was created (as a backup)
- name: Upload ZIP Package
uses: actions/upload-artifact@v3