Skip to content

Commit 171c3c6

Browse files
committed
Install archive provisioning profile for release CI
1 parent 04afad0 commit 171c3c6

2 files changed

Lines changed: 27 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,30 @@ jobs:
7272
security list-keychains -d user -s "${KEYCHAIN_PATH}" $(security list-keychains -d user | tr -d '"')
7373
security set-key-partition-list -S apple-tool:,apple: -s -k "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_PATH}"
7474
75-
- name: Install WeatherKit provisioning profile
75+
- name: Install archive provisioning profile
76+
env:
77+
ARCHIVE_PROVISIONING_PROFILE_BASE64: ${{ secrets.ARCHIVE_PROVISIONING_PROFILE_BASE64 }}
78+
run: |
79+
if [[ -z "${ARCHIVE_PROVISIONING_PROFILE_BASE64}" ]]; then
80+
echo "Missing signing secret. Configure ARCHIVE_PROVISIONING_PROFILE_BASE64." >&2
81+
exit 1
82+
fi
83+
84+
PROFILE_DIR="$HOME/Library/MobileDevice/Provisioning Profiles"
85+
PROFILE_PATH="$RUNNER_TEMP/core-monitor-archive.provisionprofile"
86+
PROFILE_PLIST="$RUNNER_TEMP/core-monitor-archive.plist"
87+
88+
mkdir -p "${PROFILE_DIR}"
89+
echo -n "${ARCHIVE_PROVISIONING_PROFILE_BASE64}" | base64 -D > "${PROFILE_PATH}"
90+
security cms -D -i "${PROFILE_PATH}" > "${PROFILE_PLIST}"
91+
92+
PROFILE_UUID=$(/usr/libexec/PlistBuddy -c "Print UUID" "${PROFILE_PLIST}")
93+
PROFILE_NAME=$(/usr/libexec/PlistBuddy -c "Print Name" "${PROFILE_PLIST}")
94+
95+
cp "${PROFILE_PATH}" "${PROFILE_DIR}/${PROFILE_UUID}.provisionprofile"
96+
echo "ARCHIVE_PROVISIONING_PROFILE_SPECIFIER=${PROFILE_NAME}" >> "${GITHUB_ENV}"
97+
98+
- name: Install direct distribution provisioning profile
7699
env:
77100
WEATHERKIT_PROVISIONING_PROFILE_BASE64: ${{ secrets.WEATHERKIT_PROVISIONING_PROFILE_BASE64 }}
78101
run: |

RELEASING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The release workflow expects these repository or organization secrets:
2020
- `BUILD_CERTIFICATE_BASE64`: base64-encoded Developer ID Application `.p12`
2121
- `P12_PASSWORD`: password for the `.p12`
2222
- `KEYCHAIN_PASSWORD`: temporary keychain password used on the runner
23+
- `ARCHIVE_PROVISIONING_PROFILE_BASE64`: base64-encoded `Mac Team Provisioning Profile: CoreTools.Core-Monitor` for the archive step
2324
- `WEATHERKIT_PROVISIONING_PROFILE_BASE64`: base64-encoded `Mac Team Direct Provisioning Profile: CoreTools.Core-Monitor`
2425
- `APPLE_TEAM_ID`: Apple Developer team id when using Apple ID notarization
2526
- For notarization, configure one of these:
@@ -71,10 +72,9 @@ Signed archive + zip:
7172
./scripts/release/build_release.sh
7273
```
7374

74-
`build_release.sh` forces a manual `Developer ID Application` signing identity for the archive step so the release path does not depend on whichever automatic-signing identity Xcode happens to prefer locally.
75-
`build_release.sh` now archives with automatic signing and then performs a `developer-id` export so the release artifact keeps the WeatherKit entitlement while still shipping as a Developer ID app.
75+
`build_release.sh` now archives with automatic signing against the WeatherKit-enabled development profile installed on the machine, then performs a `developer-id` export so the release artifact keeps the WeatherKit entitlement while still shipping as a Developer ID app.
7676

77-
The repository's `Release` configuration now uses the WeatherKit entitlement. The direct-download path therefore depends on the direct-distribution provisioning profile secret listed above.
77+
The repository's `Release` configuration now uses the WeatherKit entitlement. The direct-download path therefore depends on both provisioning profile secrets listed above: the development profile for the archive phase and the direct-distribution profile for the export phase.
7878

7979
Notarize and staple the app:
8080

0 commit comments

Comments
 (0)