Skip to content

Commit 745f877

Browse files
committed
fix: swap CI entitlements during build to bypass iCloud provisioning requirement
1 parent e351c1c commit 745f877

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

TablePro/TablePro.ci.entitlements

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.app-sandbox</key>
6+
<false/>
7+
<key>com.apple.security.cs.disable-library-validation</key>
8+
<true/>
9+
</dict>
10+
</plist>

scripts/build-release.sh

Lines changed: 18 additions & 2 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+
# Use CI entitlements (without iCloud) during build to avoid provisioning
340+
# profile requirement. The app is re-signed with real entitlements after build.
341+
local ci_entitlements="TablePro/TablePro.ci.entitlements"
342+
local real_entitlements="TablePro/TablePro.entitlements"
343+
if [ -f "$ci_entitlements" ]; then
344+
echo "📋 Using CI entitlements (iCloud stripped for build)..."
345+
cp "$real_entitlements" "$real_entitlements.bak"
346+
cp "$ci_entitlements" "$real_entitlements"
347+
fi
348+
339349
# Build with xcodebuild
340350
echo "Running xcodebuild..."
341351
if ! xcodebuild \
@@ -345,6 +355,7 @@ build_for_arch() {
345355
-arch "$arch" \
346356
ONLY_ACTIVE_ARCH=YES \
347357
CODE_SIGN_IDENTITY="$SIGN_IDENTITY" \
358+
CODE_SIGN_STYLE=Manual \
348359
DEVELOPMENT_TEAM="$TEAM_ID" \
349360
${ANALYTICS_HMAC_SECRET:+ANALYTICS_HMAC_SECRET="$ANALYTICS_HMAC_SECRET"} \
350361
-skipPackagePluginValidation \
@@ -356,6 +367,11 @@ build_for_arch() {
356367
fi
357368
echo "✅ Build succeeded for $arch"
358369

370+
# Restore real entitlements
371+
if [ -f "$real_entitlements.bak" ]; then
372+
mv "$real_entitlements.bak" "$real_entitlements"
373+
fi
374+
359375
# Get binary path with validation
360376
DERIVED_DATA=$(echo "$build_settings" | grep -m 1 "BUILD_DIR" | awk '{print $3}')
361377

@@ -501,8 +517,8 @@ build_for_arch() {
501517
done
502518
fi
503519

504-
# Sign the app bundle last
505-
codesign -fs "$SIGN_IDENTITY" --force --options runtime --timestamp "$BUILD_DIR/$OUTPUT_NAME"
520+
# Sign the app bundle last (with real entitlements including iCloud)
521+
codesign -fs "$SIGN_IDENTITY" --force --options runtime --timestamp --entitlements "$real_entitlements" "$BUILD_DIR/$OUTPUT_NAME"
506522
echo "✅ Code signing complete"
507523

508524
# Verify signature

0 commit comments

Comments
 (0)