-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodemagic.yaml
More file actions
138 lines (137 loc) · 4.37 KB
/
Copy pathcodemagic.yaml
File metadata and controls
138 lines (137 loc) · 4.37 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
workflows:
ios-release:
name: iOS Release
max_build_duration: 60
instance_type: mac_mini_m2
integrations:
app_store_connect: Codemagic CI
environment:
ios_signing:
distribution_type: app_store
bundle_identifier: online.proagentstore.app
vars:
XCODE_SCHEME: PAGS
XCODE_PROJECT: PAGS.xcodeproj
BUNDLE_ID: online.proagentstore.app
xcode: latest
scripts:
- name: Prepare Xcode project
script: |
cd ios
if command -v xcodegen >/dev/null 2>&1; then
xcodegen generate
else
echo "xcodegen not available; using checked-in $XCODE_PROJECT"
fi
- name: Native-only guard
script: |
if grep -R -E "WKWebView|WebView|SFSafariViewController|SafariServices|UIViewRepresentable" ios/PAGS; then
echo "Native-only guard failed: web embedding API found."
exit 1
fi
- name: Set up code signing
script: |
xcode-project use-profiles
- name: Increment build number
script: |
cd ios
if [ -n "${APP_STORE_APP_ID:-}" ]; then
LATEST_BUILD=$(app-store-connect get-latest-testflight-build-number "$APP_STORE_APP_ID" || echo 0)
agvtool new-version -all $((LATEST_BUILD + 1))
else
agvtool new-version -all "${CM_BUILD_NUMBER:-1}"
fi
- name: Build IPA
script: |
cd ios
xcode-project build-ipa \
--project "$XCODE_PROJECT" \
--scheme "$XCODE_SCHEME" \
--archive-flags="-destination 'generic/platform=iOS'"
artifacts:
- ios/build/ios/ipa/*.ipa
- /tmp/xcodebuild_logs/*.log
publishing:
app_store_connect:
auth: integration
submit_to_testflight: true
expire_build_submitted_for_review: true
ios-testflight:
name: iOS TestFlight
max_build_duration: 60
instance_type: mac_mini_m2
integrations:
app_store_connect: Codemagic CI
environment:
ios_signing:
distribution_type: app_store
bundle_identifier: online.proagentstore.app
vars:
XCODE_SCHEME: PAGS
XCODE_PROJECT: PAGS.xcodeproj
BUNDLE_ID: online.proagentstore.app
xcode: latest
triggering:
events:
- push
branch_patterns:
- pattern: main
include: true
cancel_previous_builds: true
scripts:
- name: Prepare Xcode project
script: |
cd ios
if command -v xcodegen >/dev/null 2>&1; then
xcodegen generate
else
echo "xcodegen not available; using checked-in $XCODE_PROJECT"
fi
- name: Native-only guard
script: |
if grep -R -E "WKWebView|WebView|SFSafariViewController|SafariServices|UIViewRepresentable" ios/PAGS; then
echo "Native-only guard failed: web embedding API found."
exit 1
fi
- name: Run unit tests
script: |
cd ios
xcodebuild test \
-project "$XCODE_PROJECT" \
-scheme "$XCODE_SCHEME" \
-destination 'platform=iOS Simulator,name=iPhone 16' \
-derivedDataPath .build/test
- name: Static analyzer
script: |
cd ios
xcodebuild analyze \
-project "$XCODE_PROJECT" \
-scheme "$XCODE_SCHEME" \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath .build/analyze
- name: Set up code signing
script: |
xcode-project use-profiles
- name: Increment build number
script: |
cd ios
if [ -n "${APP_STORE_APP_ID:-}" ]; then
LATEST_BUILD=$(app-store-connect get-latest-testflight-build-number "$APP_STORE_APP_ID" || echo 0)
agvtool new-version -all $((LATEST_BUILD + 1))
else
agvtool new-version -all "${CM_BUILD_NUMBER:-1}"
fi
- name: Build IPA
script: |
cd ios
xcode-project build-ipa \
--project "$XCODE_PROJECT" \
--scheme "$XCODE_SCHEME" \
--archive-flags="-destination 'generic/platform=iOS'"
artifacts:
- ios/build/ios/ipa/*.ipa
- /tmp/xcodebuild_logs/*.log
publishing:
app_store_connect:
auth: integration
submit_to_testflight: true