Skip to content

Commit de88fd8

Browse files
authored
Merge pull request #9 from AbdoWa7eed/ci-cd-setup
Implement Firebase App Distribution for Android via Fastlane
2 parents 90a408e + 877a87b commit de88fd8

File tree

10 files changed

+350
-0
lines changed

10 files changed

+350
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Android Fastlane with Firebase App Distribution Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
distribute_to_firebase:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repo Code
13+
uses: actions/checkout@v2
14+
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v2
17+
with:
18+
java-version: '17'
19+
distribution: 'temurin'
20+
21+
- name: Install Flutter
22+
uses: subosito/flutter-action@v2
23+
with:
24+
channel: stable
25+
26+
- name: Setup Ruby
27+
uses: ruby/setup-ruby@v1
28+
with:
29+
ruby-version: "3.3.7"
30+
bundler-cache: true
31+
working-directory: android
32+
33+
- name: Fix Ruby Bundler Platform Mismatch
34+
run: bundle lock --add-platform x86_64-linux
35+
working-directory: android
36+
37+
- name: Install Fastlane dependencies
38+
run: bundle install
39+
working-directory: android
40+
41+
- name: Build and Distribute App
42+
env:
43+
FIREBASE_CLI_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
44+
run: |
45+
bundle exec fastlane android firebase_distribution
46+
working-directory: android

android/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source "https://rubygems.org"
2+
3+
gem "fastlane"
4+
5+
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
6+
eval_gemfile(plugins_path) if File.exist?(plugins_path)

android/Gemfile.lock

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

android/app/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
plugins {
22
id("com.android.application")
3+
// START: FlutterFire Configuration
4+
id("com.google.gms.google-services")
5+
// END: FlutterFire Configuration
36
id("kotlin-android")
47
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
58
id("dev.flutter.flutter-gradle-plugin")

android/app/google-services.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"project_info": {
3+
"project_number": "60473744429",
4+
"project_id": "graduation-project-4ab31",
5+
"storage_bucket": "graduation-project-4ab31.firebasestorage.app"
6+
},
7+
"client": [
8+
{
9+
"client_info": {
10+
"mobilesdk_app_id": "1:60473744429:android:fa2a87bd508181659faca4",
11+
"android_client_info": {
12+
"package_name": "com.example.graduation_project"
13+
}
14+
},
15+
"oauth_client": [],
16+
"api_key": [
17+
{
18+
"current_key": "AIzaSyCEcygl6JupHs9YU1H8idxz_MgwiB6BNsk"
19+
}
20+
],
21+
"services": {
22+
"appinvite_service": {
23+
"other_platform_oauth_client": []
24+
}
25+
}
26+
}
27+
],
28+
"configuration_version": "1"
29+
}

android/fastlane/Appfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
2+
package_name("com.example.graduation_project") # e.g. com.krausefx.app

android/fastlane/Fastfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
default_platform(:android)
3+
4+
platform :android do
5+
desc "Firebase App Distribution Android Lane "
6+
lane :firebase_distribution do
7+
sh "flutter clean"
8+
sh "flutter build apk --release --no-tree-shake-icons"
9+
release_notes = "New Release After #{`git log -1 --pretty=%B | tail -n +2`.strip}"
10+
firebase_app_distribution(
11+
app: "1:60473744429:android:fa2a87bd508181659faca4",
12+
firebase_cli_token: ENV["FIREBASE_CLI_TOKEN"],
13+
android_artifact_path: "../build/app/outputs/flutter-apk/app-release.apk",
14+
android_artifact_type: "APK",
15+
groups: "trusted-testers",
16+
release_notes: release_notes
17+
)
18+
end
19+
20+
end

android/fastlane/Pluginfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Autogenerated by fastlane
2+
#
3+
# Ensure this file is checked in to source control!
4+
5+
gem 'fastlane-plugin-firebase_app_distribution'

android/settings.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ pluginManagement {
1919
plugins {
2020
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
2121
id("com.android.application") version "8.7.0" apply false
22+
// START: FlutterFire Configuration
23+
id("com.google.gms.google-services") version("4.3.15") apply false
24+
// END: FlutterFire Configuration
2225
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
2326
}
2427

firebase.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"flutter":{"platforms":{"android":{"default":{"projectId":"graduation-project-4ab31","appId":"1:60473744429:android:fa2a87bd508181659faca4","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"graduation-project-4ab31","configurations":{"android":"1:60473744429:android:fa2a87bd508181659faca4","ios":"1:60473744429:ios:dea09a811422790b9faca4","macos":"1:60473744429:ios:dea09a811422790b9faca4","web":"1:60473744429:web:e0cef6418d6f77469faca4","windows":"1:60473744429:web:f95af3d7cb7b99a89faca4"}}}}}}

0 commit comments

Comments
 (0)