Skip to content

Commit 70bec33

Browse files
committed
fix: pass provisioning profile to xcodebuild for iCloud entitlements
1 parent 0ff7f0a commit 70bec33

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

scripts/build-release.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,16 @@ build_for_arch() {
336336
SPM_CACHE_DIR="${HOME}/.spm-cache"
337337
mkdir -p "$SPM_CACHE_DIR"
338338

339+
# Detect provisioning profile UUID for iCloud entitlements
340+
local PROFILE_SPECIFIER=""
341+
PROFILE_PATH=$(find ~/Library/MobileDevice/Provisioning\ Profiles -name "*.provisionprofile" -print -quit 2>/dev/null)
342+
if [ -n "${PROFILE_PATH:-}" ]; then
343+
PROFILE_SPECIFIER=$(/usr/libexec/PlistBuddy -c "Print UUID" /dev/stdin <<< "$(security cms -D -i "$PROFILE_PATH" 2>/dev/null)" || true)
344+
if [ -n "$PROFILE_SPECIFIER" ]; then
345+
echo "📋 Using provisioning profile: $PROFILE_SPECIFIER"
346+
fi
347+
fi
348+
339349
# Build with xcodebuild
340350
echo "Running xcodebuild..."
341351
if ! xcodebuild \
@@ -347,6 +357,7 @@ build_for_arch() {
347357
CODE_SIGN_IDENTITY="$SIGN_IDENTITY" \
348358
CODE_SIGN_STYLE=Manual \
349359
DEVELOPMENT_TEAM="$TEAM_ID" \
360+
${PROFILE_SPECIFIER:+PROVISIONING_PROFILE_SPECIFIER="$PROFILE_SPECIFIER"} \
350361
${ANALYTICS_HMAC_SECRET:+ANALYTICS_HMAC_SECRET="$ANALYTICS_HMAC_SECRET"} \
351362
-skipPackagePluginValidation \
352363
-clonedSourcePackagesDirPath "$SPM_CACHE_DIR" \

0 commit comments

Comments
 (0)