Skip to content

Commit 1d1bcea

Browse files
committed
fix: pass provisioning profile to xcodebuild archive for iCloud entitlement
1 parent 5257ec3 commit 1d1bcea

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/build-release.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,14 @@ build_for_arch() {
360360
# ── Step 1: Archive ──
361361
local archive_path="build/TablePro-${arch}.xcarchive"
362362
echo "📦 Archiving..."
363+
# Resolve provisioning profile name for archive
364+
local archive_profile_name=""
365+
local profile_path_for_archive
366+
profile_path_for_archive=$(find ~/Library/MobileDevice/Provisioning\ Profiles -name "*.provisionprofile" -print -quit 2>/dev/null || true)
367+
if [ -n "${profile_path_for_archive:-}" ]; then
368+
archive_profile_name=$(/usr/libexec/PlistBuddy -c "Print Name" /dev/stdin <<< "$(security cms -D -i "$profile_path_for_archive" 2>/dev/null)" 2>/dev/null || true)
369+
fi
370+
363371
if ! xcodebuild archive \
364372
-project "$PROJECT" \
365373
-scheme "$SCHEME" \
@@ -370,6 +378,7 @@ build_for_arch() {
370378
CODE_SIGN_IDENTITY="$SIGN_IDENTITY" \
371379
CODE_SIGN_STYLE=Manual \
372380
DEVELOPMENT_TEAM="$TEAM_ID" \
381+
${archive_profile_name:+PROVISIONING_PROFILE_SPECIFIER="$archive_profile_name"} \
373382
${ANALYTICS_HMAC_SECRET:+ANALYTICS_HMAC_SECRET="$ANALYTICS_HMAC_SECRET"} \
374383
-skipPackagePluginValidation \
375384
-clonedSourcePackagesDirPath "$SPM_CACHE_DIR" \

0 commit comments

Comments
 (0)