-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodemagic.yaml
More file actions
94 lines (94 loc) · 3.47 KB
/
Copy pathcodemagic.yaml
File metadata and controls
94 lines (94 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
workflows:
ios-unsigned:
name: iOS Unsigned IPA
max_build_duration: 60
instance_type: mac_mini_m2
environment:
node: latest
xcode: latest
cocoapods: default
scripts:
- name: Install dependencies
script: |
set -e
cd ClipDropper-iOS
npm install
- name: Generate native iOS project
script: |
set -e
cd ClipDropper-iOS
npx expo prebuild --platform ios --no-install
echo "=== ios/ contents ==="
ls -la ios/
- name: Install CocoaPods
script: |
set -e
cd ClipDropper-iOS/ios
pod install --repo-update
echo "=== Workspace check ==="
ls -la .
- name: Build unsigned
script: |
set -e
xcodebuild \
-workspace ClipDropper-iOS/ios/ClipDropper.xcworkspace \
-scheme ClipDropper \
-sdk iphoneos \
-configuration Release \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
ONLY_ACTIVE_ARCH=NO \
build \
-derivedDataPath derived
- name: Ad-hoc sign with entitlements
# Sideloadly can only re-register App Groups (needed by the share
# extension) if the IPA's code signature carries the entitlements.
# Ad-hoc signing ("-") embeds them without needing any certificate.
script: |
set -e
APP=$(find derived -name "*.app" -path "*/Release-iphoneos/*" | head -1)
echo "App: $APP"
APP_ENT=$(find ClipDropper-iOS/ios -name "*.entitlements" -not -path "*ShareExtension*" | head -1)
EXT_ENT=$(find ClipDropper-iOS/ios -path "*ShareExtension*" -name "*.entitlements" | head -1)
echo "=== App entitlements: $APP_ENT ==="
[ -n "$APP_ENT" ] && cat "$APP_ENT"
echo "=== Extension entitlements: $EXT_ENT ==="
[ -n "$EXT_ENT" ] && cat "$EXT_ENT"
# Sign innermost first: frameworks, then the extension, then the app
if [ -d "$APP/Frameworks" ]; then
for f in "$APP/Frameworks"/*; do codesign --force --sign - "$f"; done
fi
APPEX=$(find "$APP/PlugIns" -name "*.appex" 2>/dev/null | head -1 || true)
if [ -n "$APPEX" ]; then
echo "Extension: $APPEX"
if [ -d "$APPEX/Frameworks" ]; then
for f in "$APPEX/Frameworks"/*; do codesign --force --sign - "$f"; done
fi
if [ -n "$EXT_ENT" ]; then
codesign --force --sign - --entitlements "$EXT_ENT" "$APPEX"
else
codesign --force --sign - "$APPEX"
fi
fi
if [ -n "$APP_ENT" ]; then
codesign --force --sign - --entitlements "$APP_ENT" "$APP"
else
codesign --force --sign - "$APP"
fi
echo "=== Verify embedded entitlements (app) ==="
codesign -d --entitlements - "$APP" || true
if [ -n "$APPEX" ]; then
echo "=== Verify embedded entitlements (extension) ==="
codesign -d --entitlements - "$APPEX" || true
fi
- name: Package into IPA
script: |
set -e
APP=$(find derived -name "*.app" -path "*/Release-iphoneos/*" | head -1)
echo "Found app: $APP"
mkdir -p Payload
cp -r "$APP" Payload/
zip -r ClipDropper.ipa Payload/
artifacts:
- ClipDropper.ipa