Skip to content

Commit

Permalink
chore: Setup fox iOS Firebase App Distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
niyajali committed Nov 26, 2024
1 parent a6a2de6 commit c5c35f4
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 23 deletions.
59 changes: 55 additions & 4 deletions .github/workflows/internal_or_beta_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
SUPPLY_UPLOAD_MAX_RETRIES: 5

jobs:
build_desktop_app:
build_desktop_and_ios_app:
strategy:
matrix:
os:
Expand All @@ -47,7 +47,23 @@ jobs:
NOTARIZATION_TEAM_ID: ${{ secrets.NOTARIZATION_TEAM_ID }}
run: ./gradlew packageReleaseDistributionForCurrentOS

app_build:
- name: Configure Ruby
if: ${{ matrix.os }} == 'macos-latest'
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
with:
bundler-cache: true

- name: Install Fastlane
if: ${{ matrix.os }} == 'macos-latest'
run: |
gem install bundler:2.2.27
bundle install --jobs 4 --retry 3
- name: Build iOS App
if: ${{ matrix.os }} == 'macos-latest'
run: bundle exec fastlane ios build_ios

distribute_android_app:
name: Github, Firebase Release
needs: [ build_desktop_app ]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -131,6 +147,7 @@ jobs:

- name: ☁️ Deploy to Firebase
if: github.event.inputs.release_type == 'beta'
env:
KEYSTORE_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }}
KEYSTORE_ALIAS: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS }}
Expand All @@ -141,10 +158,45 @@ jobs:
- name: Print `git status`
run: git status

distribute_ios_app:
name: Build iOS App
if: github.event.inputs.release_type == 'beta'
needs: [ app_build ]
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Configure Ruby
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
with:
bundler-cache: true

- name: Install Fastlane
run: |
gem install bundler:2.2.27
bundle install --jobs 4 --retry 3
- name: Upload iOS App to Firebase Distribution
run: bundle exec fastlane ios distribute_ios_app

- name: Print `git status`
run: git status

play_publish:
name: Play Publish
if: ${{ inputs.publish_to_play_store == true }}
runs-on: ubuntu-latest
runs-on: macos-latest
concurrency:
group: playstore_deploy
permissions:
Expand All @@ -168,7 +220,6 @@ jobs:
- name: Install Fastlane
run: |
gem install bundler:2.2.27
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Setup Gradle
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/release_to_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,4 @@ jobs:

- name: Promote Beta to Production Play Store
run: |
which ruby
ruby -v
which bundle
bundle -v
bundle exec which fastlane
bundle exec fastlane check_version
bundle exec fastlane promote_to_production
10 changes: 10 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-plugin-firebase_app_distribution (0.9.1)
google-apis-firebaseappdistribution_v1 (~> 0.3.0)
google-apis-firebaseappdistribution_v1alpha (~> 0.2.0)
fastlane-plugin-increment_build_number (0.0.4)
fastlane-sirp (1.0.0)
sysrandom (~> 1.0)
gh_inspector (1.1.3)
Expand All @@ -123,6 +127,10 @@ GEM
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
rexml
google-apis-firebaseappdistribution_v1 (0.3.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-firebaseappdistribution_v1alpha (0.2.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-iamcredentials_v1 (0.17.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-playcustomapp_v1 (0.13.0)
Expand Down Expand Up @@ -217,6 +225,8 @@ PLATFORMS

DEPENDENCIES
fastlane
fastlane-plugin-firebase_app_distribution
fastlane-plugin-increment_build_number

RUBY VERSION
ruby 3.3.5p100
Expand Down
42 changes: 35 additions & 7 deletions fastlane/FastFile
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,38 @@ platform :android do
)
end

desc "Check Version"
lane :check_version do
gradle(
task: "versionFile"
)
end
end
end


platform :ios do
desc "Build iOS application"
lane :build_ios do
build_ios_app(
project: "../mifospay-ios/iosApp.xcodeproj/project.pbxproj",
# Set configuration to debug for now
configuration: "Debug",
output_directory: "../mifospay-ios/",
output_name: "mifospay-ios-app"
)
end

desc "Upload iOS application to Firebase App Distribution"
lane :distribute_ios_app do
increment_build_number(
xcodeproj: "../mifospay-ios/iosApp.xcodeproj/project.pbxproj"
)

build_ios_app(
project: "../mifospay-ios/iosApp.xcodeproj/project.pbxproj",
# Set configuration to debug for now
configuration: "Debug",
)
release = firebase_app_distribution(
app: "1:728434912738:ios:86a7badfaed88b841a1dbb",
service_credentials_file: "../mifospay-android/firebaseAppDistributionServiceCredentialsFile.json",
release_notes_file: "../mifospay-android/build/outputs/changelogBeta",
groups: "mifos-wallet-testers"
)

end
end
4 changes: 3 additions & 1 deletion fastlane/PluginFile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!
# Ensure this file is checked in to source control!
gem 'fastlane-plugin-firebase_app_distribution'
gem 'fastlane-plugin-increment_build_number'
19 changes: 16 additions & 3 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,26 @@ Promote internal tracks to beta on Google Play

Promote beta tracks to production on Google Play

### android check_version
----


## iOS

### ios build_ios

```sh
[bundle exec] fastlane ios build_ios
```

Build iOS application

### ios distribute_ios_app

```sh
[bundle exec] fastlane android check_version
[bundle exec] fastlane ios distribute_ios_app
```

Check Version
Upload iOS application to Firebase App Distribution

----

Expand Down
4 changes: 2 additions & 2 deletions mifospay-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ dependencyGuard {
}

firebaseAppDistribution {
serviceCredentialsFile = "mifospay-android/firebaseAppDistributionServiceCredentialsFile.json"
releaseNotesFile = "./mifospay-android/build/outputs/changelogBeta"
serviceCredentialsFile = "firebaseAppDistributionServiceCredentialsFile.json"
releaseNotesFile = "build/outputs/changelogBeta"
groups = "mifos-wallet-testers"
}

Expand Down

0 comments on commit c5c35f4

Please sign in to comment.