diff --git a/.github/workflows/multi-platform-build-and-publish.yml b/.github/workflows/multi-platform-build-and-publish.yml index aec6fa162..6f399984a 100644 --- a/.github/workflows/multi-platform-build-and-publish.yml +++ b/.github/workflows/multi-platform-build-and-publish.yml @@ -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: diff --git a/.github/workflows/promote-to-production.yml b/.github/workflows/promote-to-production.yml index 18a195e95..01400a261 100644 --- a/.github/workflows/promote-to-production.yml +++ b/.github/workflows/promote-to-production.yml @@ -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' diff --git a/.github/workflows/tag-weekly-release.yml b/.github/workflows/tag-weekly-release.yml index 3b494debf..9607410db 100644 --- a/.github/workflows/tag-weekly-release.yml +++ b/.github/workflows/tag-weekly-release.yml @@ -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" diff --git a/.gitignore b/.gitignore index 1f814a674..422f7d4d8 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,4 @@ playStorePublishServiceCredentialsFile.json # Ruby stuff we don't care about .bundle/ vendor/ +secrets/ diff --git a/fastlane/AppFile b/fastlane/AppFile index fce8506d0..0e09afc8d 100644 --- a/fastlane/AppFile +++ b/fastlane/AppFile @@ -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 \ No newline at end of file diff --git a/fastlane/FastFile b/fastlane/FastFile index 105fdf1ce..7fa1a59a2 100644 --- a/fastlane/FastFile +++ b/fastlane/FastFile @@ -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,73 +100,129 @@ 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 -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 - 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", - skip_codesigning: "true", - skip_archive: "true" - ) - end + desc "Build iOS application" + lane :build_ios do |options| + # Set default configuration if not provided + options[:configuration] ||= "Debug" - lane :increment_version do - latest_release = firebase_app_distribution_get_latest_release( - app: "1:728434912738:ios:86a7badfaed88b841a1dbb" - ) - increment_build_number( - xcodeproj: "mifospay-ios/iosApp.xcodeproj", - build_number: latest_release[:buildVersion].to_i + 1 - ) - end + # 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: options[:configuration], + skip_codesigning: "true", + output_directory: "mifospay-ios/build", + skip_archive: "true" + ) + end - desc "Upload iOS application to Firebase App Distribution" - lane :deploy_on_firebase do - increment_build_number( - xcodeproj: "mifospay-ios/iosApp.xcodeproj" - ) - - build_ios_app( - project: "mifospay-ios/iosApp.xcodeproj", - scheme: "iosApp", - configuration: "Debug", - skip_codesigning: "true", - skip_archive: "true" - ) - 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" - ) + lane :increment_version do |options| + options[:serviceCredsFile] ||= "secrets/firebaseAppDistributionServiceCredentialsFile.json" - end + latest_release = firebase_app_distribution_get_latest_release( + app: "1:728434912738:ios:86a7badfaed88b841a1dbb", + service_credentials_file: options[:serviceCredsFile] + ) + increment_build_number( + xcodeproj: "mifospay-ios/iosApp.xcodeproj", + build_number: latest_release[:buildVersion].to_i + 1 + ) + end + + desc "Upload iOS application to Firebase App Distribution" + lane :deploy_on_firebase do |options| + options[:serviceCredsFile] ||= "secrets/firebaseAppDistributionServiceCredentialsFile.json" + options[:groups] ||= "mifos-wallet-testers" + + increment_version() + build_ios() + releaseNotes = generateReleaseNotes() + release = firebase_app_distribution( + app: "1:728434912738:ios:86a7badfaed88b841a1dbb", + 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 diff --git a/fastlane/metadata/android/en-GB/changelogs/1.txt b/fastlane/metadata/android/en-GB/changelogs/1.txt new file mode 100644 index 000000000..e4a483c7b --- /dev/null +++ b/fastlane/metadata/android/en-GB/changelogs/1.txt @@ -0,0 +1 @@ + Initial Production Release \ No newline at end of file diff --git a/fastlane/metadata/android/en-GB/changelogs/default.txt b/fastlane/metadata/android/en-GB/changelogs/default.txt new file mode 100644 index 000000000..e69de29bb diff --git a/fastlane/metadata/android/en-GB/full_description.txt b/fastlane/metadata/android/en-GB/full_description.txt new file mode 100644 index 000000000..c61036f0e --- /dev/null +++ b/fastlane/metadata/android/en-GB/full_description.txt @@ -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. \ No newline at end of file diff --git a/fastlane/metadata/android/en-GB/images/featureGraphic.png b/fastlane/metadata/android/en-GB/images/featureGraphic.png new file mode 100644 index 000000000..c76b9bbf6 Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/featureGraphic.png differ diff --git a/fastlane/metadata/android/en-GB/images/icon.png b/fastlane/metadata/android/en-GB/images/icon.png new file mode 100644 index 000000000..e55881311 Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/icon.png differ diff --git a/fastlane/metadata/android/en-GB/images/phoneScreenshots/1_en-GB.png b/fastlane/metadata/android/en-GB/images/phoneScreenshots/1_en-GB.png new file mode 100644 index 000000000..1dd073dec Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/phoneScreenshots/1_en-GB.png differ diff --git a/fastlane/metadata/android/en-GB/images/phoneScreenshots/2_en-GB.png b/fastlane/metadata/android/en-GB/images/phoneScreenshots/2_en-GB.png new file mode 100644 index 000000000..61de640aa Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/phoneScreenshots/2_en-GB.png differ diff --git a/fastlane/metadata/android/en-GB/images/phoneScreenshots/3_en-GB.png b/fastlane/metadata/android/en-GB/images/phoneScreenshots/3_en-GB.png new file mode 100644 index 000000000..0c29632dd Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/phoneScreenshots/3_en-GB.png differ diff --git a/fastlane/metadata/android/en-GB/images/phoneScreenshots/4_en-GB.png b/fastlane/metadata/android/en-GB/images/phoneScreenshots/4_en-GB.png new file mode 100644 index 000000000..09029b888 Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/phoneScreenshots/4_en-GB.png differ diff --git a/fastlane/metadata/android/en-GB/images/phoneScreenshots/5_en-GB.png b/fastlane/metadata/android/en-GB/images/phoneScreenshots/5_en-GB.png new file mode 100644 index 000000000..a8c299b24 Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/phoneScreenshots/5_en-GB.png differ diff --git a/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/1_en-GB.png b/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/1_en-GB.png new file mode 100644 index 000000000..61de640aa Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/1_en-GB.png differ diff --git a/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/2_en-GB.png b/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/2_en-GB.png new file mode 100644 index 000000000..0c29632dd Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/2_en-GB.png differ diff --git a/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/3_en-GB.png b/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/3_en-GB.png new file mode 100644 index 000000000..09029b888 Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/3_en-GB.png differ diff --git a/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/4_en-GB.png b/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/4_en-GB.png new file mode 100644 index 000000000..a8c299b24 Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/4_en-GB.png differ diff --git a/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/5_en-GB.png b/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/5_en-GB.png new file mode 100644 index 000000000..1dd073dec Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/sevenInchScreenshots/5_en-GB.png differ diff --git a/fastlane/metadata/android/en-GB/images/tenInchScreenshots/1_en-GB.png b/fastlane/metadata/android/en-GB/images/tenInchScreenshots/1_en-GB.png new file mode 100644 index 000000000..3e14db65e Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/tenInchScreenshots/1_en-GB.png differ diff --git a/fastlane/metadata/android/en-GB/images/tenInchScreenshots/2_en-GB.png b/fastlane/metadata/android/en-GB/images/tenInchScreenshots/2_en-GB.png new file mode 100644 index 000000000..f66554abd Binary files /dev/null and b/fastlane/metadata/android/en-GB/images/tenInchScreenshots/2_en-GB.png differ diff --git a/fastlane/metadata/android/en-GB/short_description.txt b/fastlane/metadata/android/en-GB/short_description.txt new file mode 100644 index 000000000..59803227d --- /dev/null +++ b/fastlane/metadata/android/en-GB/short_description.txt @@ -0,0 +1 @@ +A reference implementation of Mifos platform wallet and payment capabilities. \ No newline at end of file diff --git a/fastlane/metadata/android/en-GB/title.txt b/fastlane/metadata/android/en-GB/title.txt new file mode 100644 index 000000000..e56d7c57a --- /dev/null +++ b/fastlane/metadata/android/en-GB/title.txt @@ -0,0 +1 @@ +Mifos Pay \ No newline at end of file diff --git a/fastlane/metadata/android/en-GB/video.txt b/fastlane/metadata/android/en-GB/video.txt new file mode 100644 index 000000000..e69de29bb diff --git a/mifospay-android/release_keystore.keystore b/keystores/release_keystore.keystore similarity index 100% rename from mifospay-android/release_keystore.keystore rename to keystores/release_keystore.keystore diff --git a/mifospay-android/build.gradle.kts b/mifospay-android/build.gradle.kts index 3436e56f2..6eb5b7904 100644 --- a/mifospay-android/build.gradle.kts +++ b/mifospay-android/build.gradle.kts @@ -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"