Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/release-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,25 @@ jobs:
cp "$RUNNER_TEMP/maccatalyst.provisionprofile" "$APP_PATH/Contents/embedded.provisionprofile"
echo "Embedded provisioning profile in app bundle"

- name: Inject application-identifier into entitlements
run: |
# Extract application-identifier and team-identifier from provisioning profile
# and add them to the entitlements file. codesign doesn't do this automatically
# (Xcode does). Required for TestFlight eligibility.
PROFILE_PLIST=$(security cms -D -i "$RUNNER_TEMP/maccatalyst.provisionprofile")
APP_ID=$(echo "$PROFILE_PLIST" | plutil -extract Entitlements.com\\.apple\\.application-identifier raw -o - -)
TEAM_ID=$(echo "$PROFILE_PLIST" | plutil -extract Entitlements.com\\.apple\\.developer\\.team-identifier raw -o - -)
echo "Application identifier: $APP_ID"
echo "Team identifier: $TEAM_ID"

ENTITLEMENTS="PolyPilot/Platforms/MacCatalyst/Entitlements.AppStore.plist"
/usr/libexec/PlistBuddy -c "Add :com.apple.application-identifier string $APP_ID" "$ENTITLEMENTS" 2>/dev/null || \
/usr/libexec/PlistBuddy -c "Set :com.apple.application-identifier $APP_ID" "$ENTITLEMENTS"
/usr/libexec/PlistBuddy -c "Add :com.apple.developer.team-identifier string $TEAM_ID" "$ENTITLEMENTS" 2>/dev/null || \
/usr/libexec/PlistBuddy -c "Set :com.apple.developer.team-identifier $TEAM_ID" "$ENTITLEMENTS"
echo "Updated entitlements:"
cat "$ENTITLEMENTS"

- name: Re-sign app bundle (inside-out)
env:
CODESIGN_KEY: ${{ secrets.IOS_CODESIGN_KEY }}
Expand Down