Skip to content

Commit 3fe2e3b

Browse files
committed
Feature: Add Fastlane CI/CD and GitHub workflows
1 parent 0d7e760 commit 3fe2e3b

10 files changed

Lines changed: 488 additions & 0 deletions

File tree

.github/workflows/ios-beta.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: iOS Beta
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
beta:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Ruby
18+
uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: '3.2'
21+
bundler-cache: true
22+
23+
- name: Install dependencies
24+
run: bundle install
25+
26+
- name: Build and upload TestFlight beta
27+
env:
28+
CI: "true"
29+
APPLE_ID: ${{ secrets.APPLE_ID }}
30+
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
31+
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
32+
ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }}
33+
DEV_PORTAL_TEAM_ID: ${{ secrets.DEV_PORTAL_TEAM_ID }}
34+
run: bundle exec fastlane ios beta
35+
36+

.github/workflows/ios-ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: iOS CI
2+
3+
on:
4+
push:
5+
branches:
6+
- feature/**
7+
- fix/**
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
ci:
14+
runs-on: macos-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Ruby
21+
uses: ruby/setup-ruby@v1
22+
with:
23+
ruby-version: '3.2'
24+
bundler-cache: true
25+
26+
- name: Install dependencies
27+
run: bundle install
28+
29+
- name: Run Fastlane PR checks
30+
env:
31+
CI: "true"
32+
run: bundle exec fastlane ios ci_pr
33+
34+

.github/workflows/ios-release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: iOS Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
runs-on: macos-latest
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Ruby
15+
uses: ruby/setup-ruby@v1
16+
with:
17+
ruby-version: '3.2'
18+
bundler-cache: true
19+
20+
- name: Install dependencies
21+
run: bundle install
22+
23+
- name: Build and upload App Store release
24+
env:
25+
CI: "true"
26+
APPLE_ID: ${{ secrets.APPLE_ID }}
27+
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
28+
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
29+
ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }}
30+
DEV_PORTAL_TEAM_ID: ${{ secrets.DEV_PORTAL_TEAM_ID }}
31+
run: bundle exec fastlane ios release
32+
33+

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.2.2

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source "https://rubygems.org"
2+
3+
gem "fastlane"
4+
5+

Gemfile.lock

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.8)
5+
abbrev (0.1.2)
6+
addressable (2.8.8)
7+
public_suffix (>= 2.0.2, < 8.0)
8+
artifactory (3.0.17)
9+
atomos (0.1.3)
10+
aws-eventstream (1.4.0)
11+
aws-partitions (1.1188.0)
12+
aws-sdk-core (3.239.2)
13+
aws-eventstream (~> 1, >= 1.3.0)
14+
aws-partitions (~> 1, >= 1.992.0)
15+
aws-sigv4 (~> 1.9)
16+
base64
17+
bigdecimal
18+
jmespath (~> 1, >= 1.6.1)
19+
logger
20+
aws-sdk-kms (1.118.0)
21+
aws-sdk-core (~> 3, >= 3.239.1)
22+
aws-sigv4 (~> 1.5)
23+
aws-sdk-s3 (1.205.0)
24+
aws-sdk-core (~> 3, >= 3.234.0)
25+
aws-sdk-kms (~> 1)
26+
aws-sigv4 (~> 1.5)
27+
aws-sigv4 (1.12.1)
28+
aws-eventstream (~> 1, >= 1.0.2)
29+
babosa (1.0.4)
30+
base64 (0.2.0)
31+
bigdecimal (3.3.1)
32+
claide (1.1.0)
33+
colored (1.2)
34+
colored2 (3.1.2)
35+
commander (4.6.0)
36+
highline (~> 2.0.0)
37+
csv (3.3.5)
38+
declarative (0.0.20)
39+
digest-crc (0.7.0)
40+
rake (>= 12.0.0, < 14.0.0)
41+
domain_name (0.6.20240107)
42+
dotenv (2.8.1)
43+
emoji_regex (3.2.3)
44+
excon (0.112.0)
45+
faraday (1.10.4)
46+
faraday-em_http (~> 1.0)
47+
faraday-em_synchrony (~> 1.0)
48+
faraday-excon (~> 1.1)
49+
faraday-httpclient (~> 1.0)
50+
faraday-multipart (~> 1.0)
51+
faraday-net_http (~> 1.0)
52+
faraday-net_http_persistent (~> 1.0)
53+
faraday-patron (~> 1.0)
54+
faraday-rack (~> 1.0)
55+
faraday-retry (~> 1.0)
56+
ruby2_keywords (>= 0.0.4)
57+
faraday-cookie_jar (0.0.8)
58+
faraday (>= 0.8.0)
59+
http-cookie (>= 1.0.0)
60+
faraday-em_http (1.0.0)
61+
faraday-em_synchrony (1.0.1)
62+
faraday-excon (1.1.0)
63+
faraday-httpclient (1.0.1)
64+
faraday-multipart (1.1.1)
65+
multipart-post (~> 2.0)
66+
faraday-net_http (1.0.2)
67+
faraday-net_http_persistent (1.2.0)
68+
faraday-patron (1.0.0)
69+
faraday-rack (1.0.0)
70+
faraday-retry (1.0.3)
71+
faraday_middleware (1.2.1)
72+
faraday (~> 1.0)
73+
fastimage (2.4.0)
74+
fastlane (2.229.1)
75+
CFPropertyList (>= 2.3, < 4.0.0)
76+
abbrev (~> 0.1.2)
77+
addressable (>= 2.8, < 3.0.0)
78+
artifactory (~> 3.0)
79+
aws-sdk-s3 (~> 1.0)
80+
babosa (>= 1.0.3, < 2.0.0)
81+
base64 (~> 0.2.0)
82+
bundler (>= 1.12.0, < 3.0.0)
83+
colored (~> 1.2)
84+
commander (~> 4.6)
85+
csv (~> 3.3)
86+
dotenv (>= 2.1.1, < 3.0.0)
87+
emoji_regex (>= 0.1, < 4.0)
88+
excon (>= 0.71.0, < 1.0.0)
89+
faraday (~> 1.0)
90+
faraday-cookie_jar (~> 0.0.6)
91+
faraday_middleware (~> 1.0)
92+
fastimage (>= 2.1.0, < 3.0.0)
93+
fastlane-sirp (>= 1.0.0)
94+
gh_inspector (>= 1.1.2, < 2.0.0)
95+
google-apis-androidpublisher_v3 (~> 0.3)
96+
google-apis-playcustomapp_v1 (~> 0.1)
97+
google-cloud-env (>= 1.6.0, < 2.0.0)
98+
google-cloud-storage (~> 1.31)
99+
highline (~> 2.0)
100+
http-cookie (~> 1.0.5)
101+
json (< 3.0.0)
102+
jwt (>= 2.1.0, < 3)
103+
mini_magick (>= 4.9.4, < 5.0.0)
104+
multipart-post (>= 2.0.0, < 3.0.0)
105+
mutex_m (~> 0.3.0)
106+
naturally (~> 2.2)
107+
nkf (~> 0.2.0)
108+
optparse (>= 0.1.1, < 1.0.0)
109+
plist (>= 3.1.0, < 4.0.0)
110+
rubyzip (>= 2.0.0, < 3.0.0)
111+
security (= 0.1.5)
112+
simctl (~> 1.6.3)
113+
terminal-notifier (>= 2.0.0, < 3.0.0)
114+
terminal-table (~> 3)
115+
tty-screen (>= 0.6.3, < 1.0.0)
116+
tty-spinner (>= 0.8.0, < 1.0.0)
117+
word_wrap (~> 1.0.0)
118+
xcodeproj (>= 1.13.0, < 2.0.0)
119+
xcpretty (~> 0.4.1)
120+
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
121+
fastlane-sirp (1.0.0)
122+
sysrandom (~> 1.0)
123+
gh_inspector (1.1.3)
124+
google-apis-androidpublisher_v3 (0.54.0)
125+
google-apis-core (>= 0.11.0, < 2.a)
126+
google-apis-core (0.11.3)
127+
addressable (~> 2.5, >= 2.5.1)
128+
googleauth (>= 0.16.2, < 2.a)
129+
httpclient (>= 2.8.1, < 3.a)
130+
mini_mime (~> 1.0)
131+
representable (~> 3.0)
132+
retriable (>= 2.0, < 4.a)
133+
rexml
134+
google-apis-iamcredentials_v1 (0.17.0)
135+
google-apis-core (>= 0.11.0, < 2.a)
136+
google-apis-playcustomapp_v1 (0.13.0)
137+
google-apis-core (>= 0.11.0, < 2.a)
138+
google-apis-storage_v1 (0.31.0)
139+
google-apis-core (>= 0.11.0, < 2.a)
140+
google-cloud-core (1.8.0)
141+
google-cloud-env (>= 1.0, < 3.a)
142+
google-cloud-errors (~> 1.0)
143+
google-cloud-env (1.6.0)
144+
faraday (>= 0.17.3, < 3.0)
145+
google-cloud-errors (1.5.0)
146+
google-cloud-storage (1.47.0)
147+
addressable (~> 2.8)
148+
digest-crc (~> 0.4)
149+
google-apis-iamcredentials_v1 (~> 0.1)
150+
google-apis-storage_v1 (~> 0.31.0)
151+
google-cloud-core (~> 1.6)
152+
googleauth (>= 0.16.2, < 2.a)
153+
mini_mime (~> 1.0)
154+
googleauth (1.8.1)
155+
faraday (>= 0.17.3, < 3.a)
156+
jwt (>= 1.4, < 3.0)
157+
multi_json (~> 1.11)
158+
os (>= 0.9, < 2.0)
159+
signet (>= 0.16, < 2.a)
160+
highline (2.0.3)
161+
http-cookie (1.0.8)
162+
domain_name (~> 0.5)
163+
httpclient (2.9.0)
164+
mutex_m
165+
jmespath (1.6.2)
166+
json (2.16.0)
167+
jwt (2.10.2)
168+
base64
169+
logger (1.7.0)
170+
mini_magick (4.13.2)
171+
mini_mime (1.1.5)
172+
multi_json (1.17.0)
173+
multipart-post (2.4.1)
174+
mutex_m (0.3.0)
175+
nanaimo (0.4.0)
176+
naturally (2.3.0)
177+
nkf (0.2.0)
178+
optparse (0.8.0)
179+
os (1.1.4)
180+
plist (3.7.2)
181+
public_suffix (7.0.0)
182+
rake (13.3.1)
183+
representable (3.2.0)
184+
declarative (< 0.1.0)
185+
trailblazer-option (>= 0.1.1, < 0.2.0)
186+
uber (< 0.2.0)
187+
retriable (3.1.2)
188+
rexml (3.4.4)
189+
rouge (3.28.0)
190+
ruby2_keywords (0.0.5)
191+
rubyzip (2.4.1)
192+
security (0.1.5)
193+
signet (0.21.0)
194+
addressable (~> 2.8)
195+
faraday (>= 0.17.5, < 3.a)
196+
jwt (>= 1.5, < 4.0)
197+
multi_json (~> 1.10)
198+
simctl (1.6.10)
199+
CFPropertyList
200+
naturally
201+
sysrandom (1.0.5)
202+
terminal-notifier (2.0.0)
203+
terminal-table (3.0.2)
204+
unicode-display_width (>= 1.1.1, < 3)
205+
trailblazer-option (0.1.2)
206+
tty-cursor (0.7.1)
207+
tty-screen (0.8.2)
208+
tty-spinner (0.9.3)
209+
tty-cursor (~> 0.7)
210+
uber (0.1.0)
211+
unicode-display_width (2.6.0)
212+
word_wrap (1.0.0)
213+
xcodeproj (1.27.0)
214+
CFPropertyList (>= 2.3.3, < 4.0)
215+
atomos (~> 0.1.3)
216+
claide (>= 1.0.2, < 2.0)
217+
colored2 (~> 3.1)
218+
nanaimo (~> 0.4.0)
219+
rexml (>= 3.3.6, < 4.0)
220+
xcpretty (0.4.1)
221+
rouge (~> 3.28.0)
222+
xcpretty-travis-formatter (1.0.1)
223+
xcpretty (~> 0.2, >= 0.0.7)
224+
225+
PLATFORMS
226+
arm64-darwin-24
227+
228+
DEPENDENCIES
229+
fastlane
230+
231+
BUNDLED WITH
232+
2.4.10

docs/ios-fastlane.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## iOS Fastlane & CI/CD
2+
3+
### Lanes
4+
5+
- **ci_tests**: runs tests for the `IngrediCheck` scheme on an iOS simulator.
6+
- **ci_pr**: aggregates CI checks for pull requests (currently just `ci_tests`).
7+
- **beta**: builds a TestFlight beta using Match-managed signing and uploads via `pilot`.
8+
- **release**: builds and uploads a Release build to App Store Connect via `deliver`.
9+
10+
### Local usage
11+
12+
From the repo root:
13+
14+
```bash
15+
bundle install
16+
bundle exec fastlane ios ci_tests
17+
bundle exec fastlane ios beta
18+
bundle exec fastlane ios release
19+
```
20+
21+
### Required secrets (CI)
22+
23+
- **APPLE_ID**: Apple ID used for App Store Connect.
24+
- **MATCH_GIT_URL**: Git URL of the Match certificates repo.
25+
- **MATCH_PASSWORD**: Encryption password for the Match repo.
26+
- **ITC_TEAM_ID**: App Store Connect Team ID.
27+
- **DEV_PORTAL_TEAM_ID**: Apple Developer Portal Team ID.
28+
29+
### Branch protection for `main`
30+
31+
In GitHub repository settings, configure a branch protection rule for `main` that:
32+
33+
- Requires pull requests before merging (no direct pushes).
34+
- Requires the **iOS CI** workflow (status check from `ios-ci.yml`) to pass.
35+
- Optionally requires at least one approving review and up-to-date branches.
36+
37+

fastlane/Appfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
app_identifier "llc.fungee.ingredicheck"
2+
# TODO: replace with the Apple ID used for App Store Connect / CI
3+
apple_id ENV["APPLE_ID"] || "your-apple-id@example.com"
4+
5+
# These should be set via environment variables in CI where possible
6+
itc_team_id ENV["ITC_TEAM_ID"] || ""
7+
team_id ENV["DEV_PORTAL_TEAM_ID"] || ""
8+
9+

0 commit comments

Comments
 (0)