-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcodemagic.yaml
More file actions
122 lines (103 loc) · 3.73 KB
/
codemagic.yaml
File metadata and controls
122 lines (103 loc) · 3.73 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
workflows:
ios-workflow:
name: iOS Build
environment:
groups:
- app_store_credentials # Your credentials group
vars:
XCODE_WORKSPACE: "Runner.xcworkspace"
XCODE_SCHEME: "Runner"
BUNDLE_ID: "com.example.litex" # Update with your bundle ID
xcode: latest
cocoapods: default
flutter: stable # ADD THIS LINE - Specify Flutter version
# MOVE triggering section to correct position
triggering:
events:
- push
branch_patterns:
- pattern: main
include: true
scripts:
- name: Set up keychain
script: |
keychain initialize
- name: Add code signing certificates
script: |
keychain add-certificates # ADD THIS - CRITICAL!
- name: Fix iOS deployment target
script: |
cd ios
# Backup original Podfile
cp Podfile Podfile.backup
# Update Podfile with platform 15.0
if grep -q "^platform :ios" Podfile; then
sed -i '' 's/^platform :ios.*/platform :ios, "15.0"/' Podfile
else
# Add platform line at the beginning
echo 'platform :ios, "15.0"' > Podfile.temp
cat Podfile >> Podfile.temp
mv Podfile.temp Podfile
fi
# Also update any commented platform lines
sed -i '' 's/# platform :ios.*/platform :ios, "15.0"/' Podfile
# Update Xcode project deployment target
sed -i '' 's/IPHONEOS_DEPLOYMENT_TARGET = 13.0;/IPHONEOS_DEPLOYMENT_TARGET = 15.0;/g' Runner.xcodeproj/project.pbxproj
sed -i '' 's/IPHONEOS_DEPLOYMENT_TARGET = 14.0;/IPHONEOS_DEPLOYMENT_TARGET = 15.0;/g' Runner.xcodeproj/project.pbxproj
sed -i '' 's/"IPHONEOS_DEPLOYMENT_TARGET" = "13.0"/"IPHONEOS_DEPLOYMENT_TARGET" = "15.0"/g' Runner.xcodeproj/project.pbxproj
- name: Fix Info.plist
script: |
cd ios/Runner
# Backup and convert to proper XML format
cp Info.plist Info.plist.backup
plutil -convert xml1 Info.plist || true
- name: Clean and install pods
script: |
cd ios
pod deintegrate || true
pod cache clean --all
rm -rf Pods Podfile.lock DerivedData
pod repo update
pod install --repo-update --verbose
- name: Flutter setup
script: |
flutter clean
flutter pub upgrade # Use upgrade instead of get to fix outdated packages
flutter pub get
- name: Build iOS
script: |
# FIXED: Corrected --no-codesign spelling
flutter build ipa --release
- name: Apply code signing
script: |
cd ios
xcode-project use-profiles
- name: Generate IPA
script: |
cd ios
# Ensure IPA directory exists
mkdir -p ../build/ios/ipa
# Generate IPA with explicit output path
xcode-project build-ipa \
--workspace "$XCODE_WORKSPACE" \
--scheme "$XCODE_SCHEME" \
--output "../build/ios/ipa"
# Verify IPA was created
echo "=== IPA Generation Result ==="
ls -la ../build/ios/ipa/ || echo "No IPA directory"
find ../build/ios -name "*.ipa" 2>/dev/null || echo "No IPA files found"
- name: Verify build artifacts
script: |
echo "=== Build Artifacts ==="
find build -name "*.ipa" -o -name "*.app" 2>/dev/null | head -20
artifacts:
- build/ios/ipa/*.ipa
- build/ios/ipa/*.plist
- /tmp/xcodebuild_logs/*.log
publishing:
email:
recipients:
- your-email@example.com # Update with your email
notify:
success: true
failure: true