Repository navigation
Expand file tree
/
Copy pathcodemagic.yaml
More file actions
149 lines (131 loc) · 4.93 KB
/
Copy pathcodemagic.yaml
File metadata and controls
149 lines (131 loc) · 4.93 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
139
140
141
142
143
144
145
146
147
148
149
workflows:
codex-meter-ipa:
name: Codex Meter — IPA artifact
instance_type: mac_mini_m2
max_build_duration: 60
environment:
xcode: latest
cache:
cache_paths:
- $HOME/Library/Caches/Homebrew
- $HOME/.cache/org.swift.swiftpm
- $HOME/Library/Caches/org.swift.swiftpm
triggering:
events:
- push
branch_patterns:
- pattern: master
include: true
source: true
cancel_previous_builds: true
scripts:
- name: Install xtool
script: |
set -euo pipefail
brew tap xtool-org/tap
brew trust xtool-org/tap || true
brew install xtool
xtool --version
- name: Build IPA artifact
script: |
set -euo pipefail
cd "$CM_BUILD_DIR"
xtool dev build --ipa
test -f xtool/CodexMeter.ipa
unzip -t xtool/CodexMeter.ipa
artifacts:
- xtool/CodexMeter.ipa
codex-meter-testflight:
name: Codex Meter — TestFlight
instance_type: mac_mini_m2
max_build_duration: 60
integrations:
app_store_connect: mike-appstore
environment:
ios_signing:
distribution_type: app_store
bundle_identifier: com.picklemike.codexmeter
vars:
XCODE_WORKSPACE: "xtool/CodexMeter.xcworkspace"
XCODE_PROJECT: "xtool/.xtool-tmp/CodexMeter.xcodeproj"
XCODE_SCHEME: "CodexMeter-App"
MARKETING_VERSION: "1.0.0"
BUILD_NUMBER_OFFSET: "1000"
xcode: latest
cache:
cache_paths:
- $HOME/Library/Caches/Homebrew
- $HOME/.cache/org.swift.swiftpm
- $HOME/Library/Caches/org.swift.swiftpm
scripts:
- name: Install xtool and project tooling
script: |
set -euo pipefail
brew tap xtool-org/tap
brew trust xtool-org/tap || true
brew install xtool
gem install xcodeproj --no-document
xtool --version
- name: Generate the Xcode workspace
script: |
cd "$CM_BUILD_DIR"
# Real Xcode supplies its own platform_version; this override is only
# needed by xtool's Linux linker to opt into the iOS 26 design system.
sed -i '' 's/linkerSettings: liquidGlassSDKStamp/linkerSettings: []/g' Package.swift
xtool dev generate-xcode-project
test -d "$XCODE_WORKSPACE"
test -d "$XCODE_PROJECT"
- name: Prepare App Store metadata and icon
script: |
set -euo pipefail
cd "$CM_BUILD_DIR"
APP_BUILD_NUMBER=$((PROJECT_BUILD_NUMBER + BUILD_NUMBER_OFFSET))
echo "Using App Store build number $APP_BUILD_NUMBER"
echo "APP_BUILD_NUMBER=$APP_BUILD_NUMBER" >> "$CM_ENV"
ruby Scripts/prepare_codemagic_project.rb \
"$XCODE_PROJECT" \
"$MARKETING_VERSION" \
"$APP_BUILD_NUMBER"
- name: Apply provisioning profiles
script: |
cd "$CM_BUILD_DIR"
xcode-project use-profiles --project "$XCODE_PROJECT"
- name: Compile parser tests for iOS
script: |
cd "$CM_BUILD_DIR"
swift build \
--build-tests \
--triple arm64-apple-ios17.0 \
--sdk "$(xcrun --sdk iphoneos --show-sdk-path)" \
-Xswiftc -disable-batch-mode
- name: Build signed IPA
script: |
set -euo pipefail
cd "$CM_BUILD_DIR"
xcode-project build-ipa \
--workspace "$XCODE_WORKSPACE" \
--scheme "$XCODE_SCHEME"
IPA_PATH=$(find build/ios/ipa -name '*.ipa' -type f -print -quit)
test -n "$IPA_PATH"
INFO_PATH=$(unzip -Z1 "$IPA_PATH" | grep -E '^Payload/[^/]+[.]app/Info[.]plist$' | sed -n '1p')
test -n "$INFO_PATH"
unzip -p "$IPA_PATH" "$INFO_PATH" > /tmp/CodexMeter-App-Info.plist
ARCHIVED_BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' /tmp/CodexMeter-App-Info.plist)
echo "Archived App Store build number $ARCHIVED_BUILD_NUMBER"
test "$ARCHIVED_BUILD_NUMBER" = "$APP_BUILD_NUMBER"
WIDGET_INFO_PATH=$(unzip -Z1 "$IPA_PATH" | grep -E '^Payload/[^/]+[.]app/PlugIns/[^/]+[.]appex/Info[.]plist$' | sed -n '1p')
test -n "$WIDGET_INFO_PATH"
unzip -p "$IPA_PATH" "$WIDGET_INFO_PATH" > /tmp/CodexMeter-Widget-Info.plist
WIDGET_BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' /tmp/CodexMeter-Widget-Info.plist)
echo "Archived widget build number $WIDGET_BUILD_NUMBER"
test "$WIDGET_BUILD_NUMBER" = "$APP_BUILD_NUMBER"
artifacts:
- build/ios/ipa/*.ipa
- /tmp/xcodebuild_logs/*.log
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.app
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.dSYM
publishing:
app_store_connect:
auth: integration
submit_to_testflight: true
submit_to_app_store: false