Skip to content

Commit 5e10079

Browse files
authored
Refactor: Migrate to fastlane for android & ios firebase app distribution (#1824)
This commit migrates the Android and iOS Firebase app distribution process to use Fastlane. - Removed the custom Gradle task for Firebase app distribution. - Removed the firebase appdistribution plugin from the project. - Implemented `android deploy_on_firebase` Fastlane lane for Android Firebase app distribution. - Implemented `ios deploy_on_firebase` Fastlane lane for iOS Firebase app distribution. - Updated the internal release workflow to trigger the Fastlane lanes. - Updated documentation to reflect the changes. - Updated the weekly schedule workflow to trigger the new workflow for internal release.
1 parent fcb5e48 commit 5e10079

File tree

9 files changed

+43
-311
lines changed

9 files changed

+43
-311
lines changed

.github/workflows/build_and_publish_on_platforms.yaml

+18-16
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ jobs:
8282
run: |
8383
./gradlew :mifospay-android:assembleRelease
8484
85-
86-
87-
8885
- name: Upload Android Artifact
8986
uses: actions/upload-artifact@v4
9087
with:
@@ -96,11 +93,6 @@ jobs:
9693
./mifospay-android/build/outputs/apk/prod/release/mifospay-android-prod-release.apk
9794
9895
99-
100-
101-
102-
103-
10496
publish_android_on_firebase:
10597
name: Deploy Android App On Firebase
10698
needs: [ build_android, generate_release_info ]
@@ -118,6 +110,19 @@ jobs:
118110
- name: Setup Gradle
119111
uses: gradle/actions/setup-gradle@v4
120112

113+
- name: Configure Ruby
114+
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
115+
with:
116+
bundler-cache: true
117+
118+
- name: Install Fastlane
119+
run: |
120+
gem install bundler:2.2.27
121+
bundle install --jobs 4 --retry 3
122+
bundle exec fastlane add_plugin firebase_app_distribution
123+
bundle exec fastlane add_plugin increment_build_number
124+
125+
121126
- uses: ./.github/actions/inflate-secrets
122127
name: Inflate Secrets
123128
with:
@@ -150,11 +155,8 @@ jobs:
150155
151156
- name: ☁️ Deploy to Firebase
152157
env:
153-
KEYSTORE_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }}
154-
KEYSTORE_ALIAS: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS }}
155-
KEYSTORE_ALIAS_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS_PASSWORD }}
156158
VERSION_CODE: ${{ needs.generate_release_info.outputs.version_code }}
157-
run: ./gradlew appDistributionUploadProdRelease --no-configuration-cache
159+
run: bundle exec fastlane android deploy_on_firebase
158160

159161
publish_android_on_playstore:
160162
name: Publish Android App On Play Store
@@ -518,12 +520,12 @@ jobs:
518520
shell: pwsh
519521
run: |
520522
Compress-Archive -Path './all-artifacts/web-app/*' -DestinationPath './all-artifacts/mifospay-web-app.zip'
521-
523+
522524
# Rename Ubuntu desktop artifact
523525
- name: Rename Ubuntu Desktop Artifact
524526
run: |
525527
mv ./all-artifacts/desktop-app-ubuntu-latest/mifoswallet_1.0.0-1_amd64.deb ./all-artifacts/desktop-app-ubuntu-latest/MifosWallet-1.0.0.deb
526-
528+
527529
528530
- name: Download Git Changelog
529531
uses: actions/download-artifact@v4
@@ -539,8 +541,8 @@ jobs:
539541
prerelease: true
540542
files: |
541543
./all-artifacts/android-app/prod/release/mifospay-android-prod-release.apk
542-
./all-artifacts/android-app/prod/release/mifospay-android-demo-release.apk
543-
./all-artifacts/desktop-app-windows-latest/MifosWallet-1.0.0.exe
544+
./all-artifacts/android-app/demo/release/mifospay-android-demo-release.apk
545+
./all-artifacts/desktop-app-windows-latest/exe/MifosWallet-1.0.0.exe
544546
./all-artifacts/desktop-app-windows-latest/msi/MifosWallet-1.0.0.msi
545547
./all-artifacts/desktop-app-macos-latest/MifosWallet-1.0.0.dmg
546548
./all-artifacts/desktop-app-ubuntu-latest/MifosWallet-1.0.0.deb

.github/workflows/internal_or_beta_release.yml

-280
This file was deleted.

.github/workflows/weekly.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
github.rest.actions.createWorkflowDispatch({
3232
owner: context.repo.owner,
3333
repo: context.repo.repo,
34-
workflow_id: 'internal_or_beta_release.yml',
34+
workflow_id: 'build_and_publish_on_platforms.yml',
3535
ref: 'dev',
3636
inputs: {
3737
"release_type": "beta",

build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ plugins {
1616
alias(libs.plugins.kotlin.parcelize) apply false
1717
alias(libs.plugins.dependencyGuard) apply false
1818
alias(libs.plugins.firebase.crashlytics) apply false
19-
alias(libs.plugins.firebase.appdistribution) apply false
2019
alias(libs.plugins.firebase.perf) apply false
2120
alias(libs.plugins.gms) apply false
2221
alias(libs.plugins.ksp) apply false

fastlane/FastFile

+12
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ platform :android do
3434
)
3535
end
3636

37+
desc "Upload Android application to Firebase App Distribution"
38+
lane :deploy_on_firebase do
39+
release = firebase_app_distribution(
40+
app: "1:728434912738:android:0490c291986f0a691a1dbb",
41+
service_credentials_file: "mifospay-android/firebaseAppDistributionServiceCredentialsFile.json",
42+
release_notes_file: "mifospay-android/build/outputs/changelogBeta",
43+
android_artifact_type: "APK",
44+
android_artifact_path: "mifospay-android/build/outputs/apk/prod/release/mifospay-android-prod-release.apk",
45+
groups: "mifos-wallet-testers"
46+
)
47+
end
48+
3749
end
3850

3951

0 commit comments

Comments
 (0)