chore(actions): Migrated Android & iOS Workflows to use Fastlane (#1841)

* chore: Update web dependencies

Updated the following dependencies:
- Upgraded `enhanced-resolve` from 5.17.0 to 5.18.0
- Upgraded `karma` from 6.4.3 to 6.4.4
- Upgraded `kotlin-web-helpers` to 2.0.0
- Upgraded `mocha` from 10.7.0 to 10.7.3
- Upgraded `webpack` from 5.93.0 to 5.94.0
- Upgraded `ws` from 8.5.0 to 8.18.0

Removed the following dependencies:
- `@types/eslint`
- `@types/eslint-scope`

Also, updated the multi-platform build and publish workflow to use `niyajali/mifos-mobile-github-actions` instead of `openMF/mifos-mobile-github-actions`.

* ci: Update GitHub Actions workflow

This commit updates the GitHub Actions workflows to:

- Remove the pull request trigger from the `build-and-deploy-site` workflow. The workflow will now only be triggered manually or on a schedule.
- Add `build_ios` as an input to the `multi-platform-build-and-publish` workflow to control whether the iOS app should be built.
- Remove unused inputs from the `multi-platform-build-and-publish` workflow, including `publish_desktop` and `publish_web`.

* chore: Add Fastlane lanes and update workflows

This commit introduces new Fastlane lanes for Android and iOS:

- **Android:**
  - `assembleDebugApks`: Assembles debug APKs.
  - `assembleReleaseApks`: Assembles release APKs using a keystore.
  - `bundlePlayStoreRelease`: Bundles a Play Store release, including generating a version and release notes.
  - `deploy_on_firebase`: Deploys the release APK to Firebase App Distribution.
  - `buildAndSignApp`: A private lane to build and sign the app with provided keystore credentials.
  - `generateVersion`: Generates and sets version information.
  - `generateReleaseNotes`: Generates release notes from git commits.
- **iOS:**
  - `build_ios`: Builds the iOS app with optional configuration (defaults to Debug).
  - `increment_version`: Increments the build number using Firebase App Distribution's latest release.
  - `deploy_on_firebase`: Deploys the iOS app to Firebase App Distribution, including incrementing the build number.
  - `generateReleaseNotes`: Generates release notes from git commits.

It also updates the following workflows:

- **promote-to-production.yml**: Removes the manual trigger and workflow dispatch, making it only triggered by GitHub releases.
- **tag-weekly-release.yml**: Updates the cron schedule to run weekly.
- **multi-platform-build-and-publish.yml**: Switches back to using `openMF/mifos-mobile-github-actions` instead of `niyajali/mifos-mobile-github-actions`.

Additionally, it relocates the keystore to a `keystores` directory, updates the `build.gradle.kts` file to reflect this change, and adds necessary metadata for the Play Store. It also updates the `AppFile` to use the playStorePublishServiceCredentialsFile from the secrets directory and adds a `secrets` directory to the `.gitignore`.

* ci: Remove `publish_android` input from multi-platform workflow

This commit removes the `publish_android` input from the `multi-platform-build-and-publish` workflow.
This input was previously used to control whether the Android app should be published to the Play Store.
Since this functionality is no longer required, the input has been removed to simplify the workflow configuration.

* chore: Remove `repoName` param from `generateReleaseNotes` lane

This commit removes the `repoName` parameter from the `generateReleaseNotes` lane in the Fastfile. The `repoName` parameter is no longer needed as the lane now automatically determines the repository name.

This change simplifies the `generateReleaseNotes` lane and makes it more robust.
This commit is contained in:
Sk Niyaj Ali 2024-12-31 08:54:06 +05:30 committed by GitHub
parent 6320f20e66
commit f0d3d72e05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 197 additions and 76 deletions

View File

@ -74,11 +74,6 @@ on:
default: 'dev'
description: 'Target branch for release'
publish_android:
type: boolean
default: false
description: Publish Android App On Play Store
build_ios:
type: boolean
default: false
@ -101,7 +96,7 @@ concurrency:
jobs:
multi_platform_build_and_publish:
name: Multi-Platform Build and Publish
uses: niyajali/mifos-mobile-github-actions/.github/workflows/multi-platform-build-and-publish.yaml@main
uses: openMF/mifos-mobile-github-actions/.github/workflows/multi-platform-build-and-publish.yaml@main
with:
release_type: ${{ inputs.release_type }}
target_branch: ${{ inputs.target_branch }}
@ -109,7 +104,7 @@ jobs:
ios_package_name: 'mifospay-ios' # <-- Change this to your ios package name
desktop_package_name: 'mifospay-desktop' # <-- Change this to your desktop package name
web_package_name: 'mifospay-web' # <-- Change this to your web package name
publish_android: ${{ inputs.publish_android }}
tester_groups: 'mobile-wallet-testing' # <-- Change this to your Firebase tester group
build_ios: ${{ inputs.build_ios }}
publish_ios: ${{ inputs.publish_ios }}
secrets:

View File

@ -56,12 +56,6 @@ name: Promote Release to Play Store
# 2. Automatic trigger when a GitHub release is published
on:
workflow_dispatch:
inputs:
publish_to_play_store:
required: false
default: false
description: Publish to Play Store?
type: boolean
release:
types: [ released ]
@ -77,8 +71,5 @@ jobs:
play_promote_production:
name: Promote Beta to Production Play Store
uses: openMF/mifos-mobile-github-actions/.github/workflows/promote-to-production.yaml@main
if: ${{ inputs.publish_to_play_store == true }}
secrets:
playstore_creds: ${{ secrets.PLAYSTORECREDS }}
with:
android_package_name: 'mifospay-android'

View File

@ -67,7 +67,7 @@ on:
schedule:
# Runs at 04:00 UTC every Sunday
# Cron syntax: minute hour day-of-month month day-of-week
- cron: '0 4 */2 * 0'
- cron: '0 4 * * 0'
concurrency:
group: "weekly-release"

1
.gitignore vendored
View File

@ -71,3 +71,4 @@ playStorePublishServiceCredentialsFile.json
# Ruby stuff we don't care about
.bundle/
vendor/
secrets/

View File

@ -1,2 +1,2 @@
json_key_file("mifospay-android/playStorePublishServiceCredentialsFile.json")
json_key_file("secrets/playStorePublishServiceCredentialsFile.json")
package_name("org.mifospay") # e.g. org.mifospay.demo

View File

@ -1,11 +1,85 @@
default_platform(:android)
platform :android do
desc "Assemble debug APKs."
lane :assembleDebugApks do |options|
gradle(
tasks: ["assembleDebug"],
)
end
desc "Assemble Release APK"
lane :assembleReleaseApks do |options|
options[:storeFile] ||= "release_keystore.keystore"
options[:storePassword] ||= "Mifospay"
options[:keyAlias] ||= "key0"
options[:keyPassword] ||= "Mifos@123"
# Generate version
generateVersion = generateVersion()
buildAndSignApp(
taskName: "assemble",
buildType: "Release",
storeFile: options[:storeFile],
storePassword: options[:storePassword],
keyAlias: options[:keyAlias],
keyPassword: options[:keyPassword],
)
end
desc "Bundle Play Store release"
lane :bundlePlayStoreRelease do |options|
options[:storeFile] ||= "release_keystore.keystore"
options[:storePassword] ||= "Mifospay"
options[:keyAlias] ||= "key0"
options[:keyPassword] ||= "Mifos@123"
# Generate version
generateVersion = generateVersion()
# Generate Release Note
releaseNotes = generateReleaseNotes()
# Write the generated release notes to default.txt
buildConfigPath = "metadata/android/en-GB/changelogs/default.txt"
File.write(buildConfigPath, releaseNotes)
buildAndSignApp(
taskName: "bundle",
buildType: "Release",
storeFile: options[:storeFile],
storePassword: options[:storePassword],
keyAlias: options[:keyAlias],
keyPassword: options[:keyPassword],
)
end
desc "Publish Release Play Store artifacts to Firebase App Distribution"
lane :deploy_on_firebase do |options|
options[:apkFile] ||= "mifospay-android/build/outputs/apk/prod/release/mifospay-android-prod-release.apk"
options[:serviceCredsFile] ||= "secrets/firebaseAppDistributionServiceCredentialsFile.json"
options[:groups] ||= "mifos-wallet-testers"
# Generate Release Note
releaseNotes = generateReleaseNotes()
firebase_app_distribution(
app: "1:64530857057:android:f8d67b786db1b844",
android_artifact_type: "APK",
android_artifact_path: options[:apkFile],
service_credentials_file: options[:serviceCredsFile],
groups: options[:groups],
release_notes: "#{releaseNotes}",
)
end
desc "Deploy internal tracks to Google Play"
lane :deploy_internal do
supply(
lane :deploy_internal do |options|
options[:aabFile] ||= "mifospay-android/build/outputs/bundle/prodRelease/mifospay-android-prod-release.aab"
upload_to_play_store(
track: 'internal',
aab: 'mifospay-android/build/outputs/bundle/prodRelease/mifospay-android-prod-release.aab',
aab: options[:aabFile],
skip_upload_metadata: true,
skip_upload_images: true,
skip_upload_screenshots: true,
@ -14,7 +88,7 @@ platform :android do
desc "Promote internal tracks to beta on Google Play"
lane :promote_to_beta do
supply(
upload_to_play_store(
track: 'internal',
track_promote_to: 'beta',
skip_upload_changelogs: true,
@ -26,47 +100,99 @@ platform :android do
desc "Promote beta tracks to production on Google Play"
lane :promote_to_production do
supply(
upload_to_play_store(
track: 'beta',
track_promote_to: 'production',
skip_upload_changelogs: true,
sync_image_upload: true,
skip_upload_metadata: true,
skip_upload_images: true,
skip_upload_screenshots: true,
)
end
desc "Upload Android application to Firebase App Distribution"
lane :deploy_on_firebase do
release = firebase_app_distribution(
app: "1:728434912738:android:0490c291986f0a691a1dbb",
service_credentials_file: "mifospay-android/firebaseAppDistributionServiceCredentialsFile.json",
release_notes_file: "mifospay-android/build/outputs/changelogBeta",
android_artifact_type: "APK",
android_artifact_path: "mifospay-android/build/outputs/apk/prod/release/mifospay-android-prod-release.apk",
groups: "mifos-wallet-testers"
desc "Generate artifacts for the given [build] signed with the provided [keystore] and credentials."
private_lane :buildAndSignApp do |options|
# Get the project root directory
project_dir = File.expand_path('..', Dir.pwd)
# Construct the absolute path to the keystore
keystore_path = File.join(project_dir, 'keystores', options[:storeFile])
# Check if keystore exists
unless File.exist?(keystore_path)
UI.error "Keystore file not found at: #{keystore_path}"
UI.error "Please ensure the keystore file exists at the correct location"
exit 1 # Exit with error code 1
end
gradle(
task: options[:taskName],
build_type: options[:buildType],
properties: {
"android.injected.signing.store.file" => keystore_path,
"android.injected.signing.store.password" => options[:storePassword],
"android.injected.signing.key.alias" => options[:keyAlias],
"android.injected.signing.key.password" => options[:keyPassword],
},
print_command: false,
)
end
desc "Generate Version"
lane :generateVersion do
# Generate version file
gradle(tasks: ["versionFile"])
# Set version from file
ENV['VERSION'] = File.read("../version.txt").strip
# Calculate and set version code
commit_count = `git rev-list --count HEAD`.to_i
tag_count = `git tag | grep -v beta | wc -l`.to_i
ENV['VERSION_CODE'] = ((commit_count + tag_count) << 1).to_s
UI.success("Set VERSION=#{ENV['VERSION']} VERSION_CODE=#{ENV['VERSION_CODE']}")
end
desc "Generate release notes"
lane :generateReleaseNotes do |options|
branchName = `git rev-parse --abbrev-ref HEAD`.chomp()
releaseNotes = changelog_from_git_commits(
commits_count: 1,
)
releaseNotes
end
end
platform :ios do
desc "Build iOS application"
lane :build_ios do
lane :build_ios do |options|
# Set default configuration if not provided
options[:configuration] ||= "Debug"
# automatic code signing
update_code_signing_settings(
use_automatic_signing: true,
path: "mifospay-ios/iosApp.xcodeproj"
)
build_ios_app(
project: "mifospay-ios/iosApp.xcodeproj",
scheme: "iosApp",
# Set configuration to debug for now
configuration: "Debug",
output_directory: "mifospay-ios/",
output_name: "mifospay-ios-app.ipa",
configuration: options[:configuration],
skip_codesigning: "true",
output_directory: "mifospay-ios/build",
skip_archive: "true"
)
end
lane :increment_version do
lane :increment_version do |options|
options[:serviceCredsFile] ||= "secrets/firebaseAppDistributionServiceCredentialsFile.json"
latest_release = firebase_app_distribution_get_latest_release(
app: "1:728434912738:ios:86a7badfaed88b841a1dbb"
app: "1:728434912738:ios:86a7badfaed88b841a1dbb",
service_credentials_file: options[:serviceCredsFile]
)
increment_build_number(
xcodeproj: "mifospay-ios/iosApp.xcodeproj",
@ -75,24 +201,28 @@ platform :ios do
end
desc "Upload iOS application to Firebase App Distribution"
lane :deploy_on_firebase do
increment_build_number(
xcodeproj: "mifospay-ios/iosApp.xcodeproj"
)
lane :deploy_on_firebase do |options|
options[:serviceCredsFile] ||= "secrets/firebaseAppDistributionServiceCredentialsFile.json"
options[:groups] ||= "mifos-wallet-testers"
build_ios_app(
project: "mifospay-ios/iosApp.xcodeproj",
scheme: "iosApp",
configuration: "Debug",
skip_codesigning: "true",
skip_archive: "true"
)
increment_version()
build_ios()
releaseNotes = generateReleaseNotes()
release = firebase_app_distribution(
app: "1:728434912738:ios:86a7badfaed88b841a1dbb",
service_credentials_file: "mifospay-ios/firebaseAppDistributionServiceCredentialsFile.json",
release_notes_file: "mifospay-ios/changelogBeta",
groups: "mifos-wallet-testers"
service_credentials_file: options[:serviceCredsFile],
release_notes_file: "#{releaseNotes}",
groups: options[:groups]
)
end
desc "Generate release notes"
lane :generateReleaseNotes do
branchName = `git rev-parse --abbrev-ref HEAD`.chomp()
releaseNotes = changelog_from_git_commits(
commits_count: 1,
)
releaseNotes
end
end

View File

@ -0,0 +1 @@
Initial Production Release

View File

@ -0,0 +1 @@
The Mobile Wallet project is a Kotlin Multiplatform (KMP) initiative that leverages the Apache Fineract API. The application has been meticulously crafted using cutting-edge technologies and frameworks/libraries by adhering to recommended architecture and design patterns.

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 KiB

View File

@ -0,0 +1 @@
A reference implementation of Mifos platform wallet and payment capabilities.

View File

@ -0,0 +1 @@
Mifos Pay

View File

@ -34,7 +34,7 @@ android {
signingConfigs {
create("release") {
storeFile = file(System.getenv("KEYSTORE_PATH") ?: "release_keystore.keystore")
storeFile = file(System.getenv("KEYSTORE_PATH") ?: "../keystores/release_keystore.keystore")
storePassword = System.getenv("KEYSTORE_PASSWORD") ?: "Mifospay"
keyAlias = System.getenv("KEYSTORE_ALIAS") ?: "key0"
keyPassword = System.getenv("KEYSTORE_ALIAS_PASSWORD") ?: "Mifos@123"