Skip to content

Commit 4be7180

Browse files
authored
fix: iOS pipeline and improve speed of CI/CD (#349)
1 parent 654de7d commit 4be7180

5 files changed

Lines changed: 88 additions & 19 deletions

File tree

.github/workflows/deploy_beta.yml

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,57 @@ permissions:
1010

1111
jobs:
1212
deploy:
13-
runs-on: macos-26
13+
runs-on: ${{ matrix.os }}
1414

1515
strategy:
1616
matrix:
17-
platform: [ ios, android ]
17+
include:
18+
- platform: ios
19+
os: macos-26
20+
- platform: android
21+
os: ubuntu-latest
1822
fail-fast: false
1923

2024
steps:
2125
- uses: actions/checkout@v4
2226

27+
- name: Setup Ruby and install gems
28+
uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: '3.3'
31+
working-directory: ${{ matrix.platform }}
32+
bundler-cache: true
33+
2334
- if: matrix.platform == 'android'
2435
uses: actions/setup-java@v3
2536
with:
2637
distribution: 'corretto'
2738
java-version: '21'
39+
cache: 'gradle'
2840

2941
- name: Setup Flutter
3042
uses: subosito/flutter-action@v2
3143
with:
3244
channel: stable
45+
cache: true
46+
47+
- if: matrix.platform == 'ios'
48+
name: Cache CocoaPods
49+
uses: actions/cache@v4
50+
with:
51+
path: |
52+
ios/Pods
53+
~/.cocoapods
54+
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }}
55+
restore-keys: ${{ runner.os }}-pods-
56+
57+
- if: matrix.platform == 'ios'
58+
name: Cache Xcode DerivedData (SPM + compiled pods)
59+
uses: actions/cache@v4
60+
with:
61+
path: ios/DerivedData
62+
key: ${{ runner.os }}-deriveddata-${{ hashFiles('ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved', 'ios/Podfile.lock') }}
63+
restore-keys: ${{ runner.os }}-deriveddata-
3364

3465
- name: Install Flutter Packages
3566
run: |
@@ -54,7 +85,7 @@ jobs:
5485
name: Build and Deploy With Release Notes to TestFlight
5586
run: |
5687
cd ./ios
57-
fastlane ios_beta
88+
bundle exec fastlane ios_beta
5889
env:
5990
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.ASC_KEY_ID }}
6091
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
@@ -68,7 +99,7 @@ jobs:
6899
name: Build and Deploy to TestFlight
69100
run: |
70101
cd ./ios
71-
fastlane ios_beta
102+
bundle exec fastlane ios_beta
72103
env:
73104
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.ASC_KEY_ID }}
74105
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
@@ -87,7 +118,7 @@ jobs:
87118
name: Deploy to Google Play Store
88119
run: |
89120
cd ./android
90-
fastlane android_beta
121+
bundle exec fastlane android_beta
91122
env:
92123
GOOGLE_PLAY_SERVICE_ACCOUNT_KEY: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_KEY }}
93124
ANDROID_KEYSTORE_FILE: ./upload-keystore
@@ -99,7 +130,7 @@ jobs:
99130
name: Build Release APK
100131
run: |
101132
cd ./android
102-
fastlane android_apk
133+
bundle exec fastlane android_apk
103134
env:
104135
GOOGLE_PLAY_SERVICE_ACCOUNT_KEY: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_KEY }}
105136
ANDROID_KEYSTORE_FILE: ./upload-keystore

.github/workflows/lint_test_build.yml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
pull_request:
55

66
jobs:
7-
build:
8-
runs-on: macos-26
7+
analyze_and_test:
8+
runs-on: ubuntu-latest
99

1010
steps:
1111
- uses: actions/checkout@v4
@@ -14,6 +14,7 @@ jobs:
1414
uses: subosito/flutter-action@v2
1515
with:
1616
channel: stable
17+
cache: true
1718

1819
- name: Install Flutter Packages
1920
run: flutter pub get
@@ -24,20 +25,56 @@ jobs:
2425
- name: Run Tests
2526
run: flutter test
2627

27-
- name: Install CocoaPods
28-
run: cd ./ios && pod install
28+
build:
29+
runs-on: ${{ matrix.os }}
30+
31+
strategy:
32+
matrix:
33+
include:
34+
- platform: ios
35+
os: macos-26
36+
- platform: android
37+
os: ubuntu-latest
38+
fail-fast: false
39+
40+
steps:
41+
- uses: actions/checkout@v4
2942

30-
- name: Install Java SDK
43+
- if: matrix.platform == 'android'
44+
name: Install Java SDK
3145
uses: actions/setup-java@v3
3246
with:
3347
distribution: 'corretto'
3448
java-version: '21'
49+
cache: 'gradle'
50+
51+
- name: Setup Flutter
52+
uses: subosito/flutter-action@v2
53+
with:
54+
channel: stable
55+
cache: true
56+
57+
- name: Install Flutter Packages
58+
run: flutter pub get
3559

36-
- name: Build iOS
60+
- if: matrix.platform == 'ios'
61+
name: Cache CocoaPods
62+
uses: actions/cache@v4
63+
with:
64+
path: |
65+
ios/Pods
66+
~/.cocoapods
67+
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }}
68+
restore-keys: ${{ runner.os }}-pods-
69+
70+
- if: matrix.platform == 'ios'
71+
name: Install CocoaPods
72+
run: cd ./ios && pod install
73+
74+
- if: matrix.platform == 'ios'
75+
name: Build iOS
3776
run: flutter build ipa --no-codesign
3877

39-
- name: Build Android
78+
- if: matrix.platform == 'android'
79+
name: Build Android
4080
run: flutter build apk
41-
42-
#- name: Build Website
43-
# run: flutter build web --base-href /

android/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
source "https://rubygems.org"
22

3-
gem "fastlane"
3+
gem "fastlane", ">= 2.236.1"

ios/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
source "https://rubygems.org"
22

3-
gem "fastlane"
3+
gem "fastlane", ">= 2.236.1"

ios/fastlane/Fastfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ platform :ios do
5252
scheme: "Runner",
5353
workspace: "Runner.xcworkspace",
5454
export_method: "app-store",
55-
skip_package_dependencies_resolution: true
55+
skip_package_dependencies_resolution: true,
56+
derived_data_path: "DerivedData"
5657
)
5758

5859
upload_to_testflight(

0 commit comments

Comments
 (0)