-
Notifications
You must be signed in to change notification settings - Fork 12
230 lines (195 loc) · 7.71 KB
/
ios.yml
File metadata and controls
230 lines (195 loc) · 7.71 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
---
name: iOS Release
permissions:
contents: read
on:
workflow_dispatch:
inputs:
ref_name:
description: A git commit/hash/tag (optional)
type: string
default: ""
buildEnv:
description: The iOS env to be built (optional)
type: choice
default: ""
options:
- ""
- dev
- prod
upload_to_testflight:
description: Upload build to Apple Testflight
type: choice
default: "yes"
options:
- "yes"
- "no"
release_notes:
description: TestFlight release notes (optional)
type: string
default: ""
schedule:
# Runs every day at midnight PST/PDT time (8am UTC/GMT)
- cron: "0 8 * * *"
concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: "20"
RUBY_VERSION: 3.1.4
# Apple Connect API configuration (for app_store_connect_api_key)
APPLE_CONNECT_KEY_ID: ${{ secrets.APPLE_CONNECT_KEY_ID }}
APPLE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_CONNECT_ISSUER_ID }}
APPLE_CONNECT_KEY_CONTENT: ${{ secrets.APPLE_CONNECT_KEY_CONTENT }}
# Fastlane Match configuration (GitHub App token approach)
FASTLANE_GIT_URL: ${{ vars.FASTLANE_GIT_URL }}
MATCH_PASSWORD: ${{ secrets.FASTLANE_MATCH_PASSWORD }}
# Sentry configuration
SENTRY_PROPERTIES_CONTENT: ${{ secrets.SENTRY_PROPERTIES_CONTENT }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
# Amplitude Analytics configuration
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY:
${{ secrets.AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY }}
# Backend URLs configuration
FREIGHTER_BACKEND_V1_PROD_URL: ${{ vars.FREIGHTER_BACKEND_V1_PROD_URL }}
FREIGHTER_BACKEND_V1_STG_URL: ${{ vars.FREIGHTER_BACKEND_V1_STG_URL }}
FREIGHTER_BACKEND_V1_DEV_URL: ${{ vars.FREIGHTER_BACKEND_V1_DEV_URL }}
FREIGHTER_BACKEND_V2_PROD_URL: ${{ vars.FREIGHTER_BACKEND_V2_PROD_URL }}
FREIGHTER_BACKEND_V2_STG_URL: ${{ vars.FREIGHTER_BACKEND_V2_STG_URL }}
FREIGHTER_BACKEND_V2_DEV_URL: ${{ vars.FREIGHTER_BACKEND_V2_DEV_URL }}
# Wallet Kit Configuration (Production)
WALLET_KIT_PROJECT_ID_PROD: ${{ secrets.WALLET_KIT_PROJECT_ID_PROD }}
WALLET_KIT_MT_NAME_PROD: ${{ vars.WALLET_KIT_MT_NAME_PROD }}
WALLET_KIT_MT_DESCRIPTION_PROD: ${{ vars.WALLET_KIT_MT_DESCRIPTION_PROD }}
WALLET_KIT_MT_URL_PROD: ${{ vars.WALLET_KIT_MT_URL_PROD }}
WALLET_KIT_MT_ICON_PROD: ${{ vars.WALLET_KIT_MT_ICON_PROD }}
WALLET_KIT_MT_REDIRECT_NATIVE_PROD:
${{ vars.WALLET_KIT_MT_REDIRECT_NATIVE_PROD }}
# Wallet Kit Configuration (Development)
WALLET_KIT_PROJECT_ID_DEV: ${{ secrets.WALLET_KIT_PROJECT_ID_DEV }}
WALLET_KIT_MT_NAME_DEV: ${{ vars.WALLET_KIT_MT_NAME_DEV }}
WALLET_KIT_MT_DESCRIPTION_DEV: ${{ vars.WALLET_KIT_MT_DESCRIPTION_DEV }}
WALLET_KIT_MT_URL_DEV: ${{ vars.WALLET_KIT_MT_URL_DEV }}
WALLET_KIT_MT_ICON_DEV: ${{ vars.WALLET_KIT_MT_ICON_DEV }}
WALLET_KIT_MT_REDIRECT_NATIVE_DEV:
${{ vars.WALLET_KIT_MT_REDIRECT_NATIVE_DEV }}
# MP Collections Addresses (comma-separated list of collection addresses)
MP_COLLECTIONS_ADDRESSES: ${{ vars.MP_COLLECTIONS_ADDRESSES }}
# E2E test vars: defined here for consistency with E2E workflow files (ios-e2e, android-e2e).
# They are shared by gh-ios-env → EnvFileCreator (.env) in both release and E2E workflows.
IS_E2E_TEST: "false"
E2E_TEST_RECOVERY_PHRASE: ""
jobs:
build:
name: Build iOS
runs-on: macos-26-xlarge
timeout-minutes: 60
steps:
- name: Set ref
run: |
if [[ "${{ github.event.inputs.ref_name }}" != "" ]]; then
echo "REF_NAME=${{ github.event.inputs.ref_name }}" >> $GITHUB_ENV
else
echo "REF_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
fi
- name: Checkout repo
uses: actions/checkout@v5
with:
ref: ${{ env.REF_NAME }}
- name: Generate Match Repository Token
id: match-token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
with:
app-id: ${{ vars.MATCH_GITHUB_APP_ID }}
private-key: ${{ secrets.MATCH_GITHUB_APP_PRIVATE_KEY }}
# It's preferable to hardcode "stellar" here for security reasons instead of "github.repository_owner"
owner: stellar
repositories: freighter-mobile-fastlane
- name: Make scripts executable
run: find scripts -type f -exec chmod +x {} \;
- name: Display iOS environment information
run: ./scripts/display-ios-environment
- name: Set latest stable Xcode version
run: ./scripts/setup-xcode-latest-stable
- name: Verify selected Xcode Version
run: xcodebuild -version
- name: Set env
run: |
# If the workflow is triggered by a scheduled event, always upload to TestFlight.
if [[ "${{ github.event_name }}" == "schedule" ]]; then
echo "UPLOAD_TO_TESTFLIGHT=yes" >> $GITHUB_ENV
else
echo "UPLOAD_TO_TESTFLIGHT=${{ github.event.inputs.upload_to_testflight }}" >> $GITHUB_ENV
fi
# Translate buildEnv input to iOS scheme
if [[ "${{ github.event.inputs.buildEnv }}" == "prod" ]]; then
export IOS_SCHEME="freighter-mobile"
else
export IOS_SCHEME="freighter-mobile-dev"
fi
./scripts/gh-ios-env >> $GITHUB_ENV
- name: Generate release notes
env:
INPUT_RELEASE_NOTES: ${{ github.event.inputs.release_notes || '' }}
run: scripts/generate-release-notes.sh
- name: Decode and save sentry.properties
run:
echo "$SENTRY_PROPERTIES_CONTENT" | base64 --decode >
./ios/sentry.properties
- name: Print Build config
run: |
echo "UPLOAD_TO_TESTFLIGHT=${UPLOAD_TO_TESTFLIGHT}"
echo "BUILD_VERSION=${BUILD_VERSION}"
echo "REF_NAME=${REF_NAME}"
echo "APP_VERSION=${APP_VERSION}"
echo "APP_ID=${APP_ID}"
echo "APP_NAME=${APP_NAME}"
echo "IOS_SCHEME=${IOS_SCHEME}"
echo "FASTLANE_LANE=${FASTLANE_LANE}"
- name: Enable Corepack
run: corepack enable
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: "yarn"
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true
- name: Cache Cocoapods
uses: actions/cache@v4
id: cocoapods-cache
with:
path: ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }}
- name: Run Yarn Install
run: yarn install --immutable
- name: Run Post Install
run: yarn postinstall
- name: Build and Distribute Application
id: fastlane
env:
MATCH_GIT_TOKEN: ${{ steps.match-token.outputs.token }}
run: |
bundle exec fastlane --version
bundle exec fastlane ios ${{ env.FASTLANE_LANE }}
# Dev builds: Short retention for rapid iteration
- name: Upload dev build artifacts
uses: actions/upload-artifact@v4
if: always() && env.IOS_SCHEME == 'freighter-mobile-dev'
with:
name: ios-build-dev-${{ env.BUILD_VERSION }}
path: /tmp/build
retention-days: 7
# Production builds: Extended retention given less frequent uploads
- name: Upload prod build artifacts
uses: actions/upload-artifact@v4
if: always() && env.IOS_SCHEME == 'freighter-mobile'
with:
name: ios-build-prod-${{ env.BUILD_VERSION }}
path: /tmp/build
retention-days: 30