From 80c7bb0270ceec1895de605164b0ddd03bd0192a Mon Sep 17 00:00:00 2001 From: therajanmaurya <5724482+therajanmaurya@users.noreply.github.com> Date: Mon, 5 Jan 2026 01:27:29 +0000 Subject: [PATCH] chore: Sync directories and files from upstream --- .github/workflows/build-and-deploy-site.yml | 65 ++ .github/workflows/cache-cleanup.yaml | 15 + .github/workflows/monthly-version-tag.yml | 66 ++ .../multi-platform-build-and-publish.yml | 45 +- .github/workflows/pr-check.yml | 32 +- .github/workflows/promote-to-production.yml | 4 +- .github/workflows/sync-dirs.yaml | 140 ++-- .github/workflows/tag-weekly-release.yml | 88 ++- .run/cmp-android.run.xml | 74 +++ .run/cmp-desktop.run.xml | 5 - .run/cmp-web-js.run.xml | 2 +- Gemfile | 10 +- Gemfile.lock | 148 ++--- build-logic/README.md | 10 +- build-logic/convention/build.gradle.kts | 135 ++-- ...droidApplicationComposeConventionPlugin.kt | 5 +- .../AndroidApplicationConventionPlugin.kt | 29 +- ...roidApplicationFirebaseConventionPlugin.kt | 20 +- ...droidApplicationFlavorsConventionPlugin.kt | 5 +- .../kotlin/AndroidLintConventionPlugin.kt | 17 +- .../main/kotlin/CMPFeatureConventionPlugin.kt | 47 +- .../src/main/kotlin/DetektConventionPlugin.kt | 26 + .../main/kotlin/FieldSkippingClassVisitor.kt | 4 +- .../main/kotlin/GitHooksConventionPlugin.kt | 57 ++ .../main/kotlin/KMPKoinConventionPlugin.kt | 22 +- .../main/kotlin/KMPLibraryConventionPlugin.kt | 30 +- .../main/kotlin/KMPRoomConventionPlugin.kt | 9 +- .../KeystoreManagementConventionPlugin.kt | 153 +++++ .../src/main/kotlin/KtlintConventionPlugin.kt | 19 + .../main/kotlin/SpotlessConventionPlugin.kt | 25 + .../kotlin/org/convention/AndroidCompose.kt | 63 ++ .../convention/AndroidInstrumentedTests.kt | 19 + .../kotlin/org/convention/AppBuildType.kt | 9 + .../main/kotlin/org/convention/AppFlavor.kt | 48 ++ .../src/main/kotlin/org/convention/Badging.kt | 156 +++++ .../src/main/kotlin/org/convention/Detekt.kt | 43 ++ .../org/convention/GradleManagedDevices.kt | 70 ++ .../org/convention/HierarchyTemplate.kt | 179 ++++++ .../src/main/kotlin/org/convention/Jacoco.kt | 134 ++++ .../kotlin/org/convention/KotlinAndroid.kt | 77 +++ .../org/convention/KotlinMultiplatform.kt | 40 ++ .../kotlin/org/convention/PrintTestApks.kt | 95 +++ .../org/convention/ProjectExtensions.kt | 39 ++ .../main/kotlin/org/convention/Spotless.kt | 36 ++ .../convention/keystore/BaseKeystoreTask.kt | 97 +++ .../keystore/ConfigurationFileUpdatesTask.kt | 347 ++++++++++ .../keystore/ConfigurationValidator.kt | 332 ++++++++++ .../keystore/EnvironmentOverrideHandler.kt | 306 +++++++++ .../org/convention/keystore/KeystoreConfig.kt | 76 +++ .../keystore/KeystoreGenerationTask.kt | 353 +++++++++++ .../org/convention/keystore/KeystoreLogger.kt | 46 ++ .../org/convention/keystore/SecretsConfig.kt | 65 ++ .../convention/keystore/SecretsEnvParser.kt | 243 +++++++ .../keystore/SecretsEnvUpdateTask.kt | 598 ++++++++++++++++++ .../ConfigurationFileUpdatesTaskTest.kt | 364 +++++++++++ .../keystore/KeystoreGenerationTaskTest.kt | 306 +++++++++ .../keystore/SecretsEnvParserTest.kt | 389 ++++++++++++ .../keystore/SecretsEnvUpdateTaskTest.kt | 450 +++++++++++++ build-logic/settings.gradle.kts | 16 - ci-prepush.bat | 4 +- ci-prepush.sh | 2 + cmp-android/build.gradle.kts | 105 +-- cmp-android/lint-baseline.xml | 2 +- cmp-android/prodRelease-badging.txt | 196 +++--- cmp-android/proguard-rules.pro | 4 +- cmp-android/src/main/AndroidManifest.xml | 56 +- .../main/kotlin/cmp/android/app/AndroidApp.kt | 28 +- .../cmp/android/app/AppThemeExtensions.kt | 21 + .../cmp/android/app/BuildConfigUtils.kt | 65 ++ .../app/ComponentActivityExtensions.kt | 51 +- .../cmp/android/app/ConfigurationExtension.kt | 15 + .../kotlin/cmp/android/app/MainActivity.kt | 120 ++-- cmp-android/src/prod/AndroidManifest.xml | 33 + cmp-desktop/build.gradle.kts | 93 +-- cmp-desktop/src/jvmMain/kotlin/main.kt | 9 +- cmp-ios/Configuration/Config.xcconfig | 4 +- cmp-ios/Podfile | 24 +- cmp-ios/iosApp.xcodeproj/project.pbxproj | 83 ++- .../UserInterfaceState.xcuserstate | Bin 24141 -> 34158 bytes .../xcschemes/xcschememanagement.plist | 2 +- .../xcschemes/iosApp.xcscheme | 32 + .../xcschemes/xcschememanagement.plist | 14 + .../xcschemes/xcschememanagement.plist | 5 + cmp-ios/iosApp/ContentView.swift | 3 +- cmp-ios/iosApp/Info.plist | 12 +- cmp-shared/build.gradle.kts | 29 +- cmp-shared/cmp_shared.podspec | 2 +- .../commonMain/kotlin/cmp/shared/SharedApp.kt | 29 +- .../kotlin/cmp/shared/utils/KoinExt.kt | 2 +- .../kotlin/org/mifos/shared/ViewController.kt | 4 +- cmp-web/build.gradle.kts | 9 +- cmp-web/src/jsMain/kotlin/Application.kt | 4 +- cmp-web/src/wasmJsMain/kotlin/Main.kt | 6 +- config/detekt/detekt.yml | 13 +- core-base/analytics/build.gradle.kts | 2 +- .../core/base/analytics/di/AnalyticsModule.kt | 2 +- .../src/androidMain/AndroidManifest.xml | 2 +- .../di/AnalyticsModule.kt | 2 +- .../core/base/analytics/AnalyticsEvent.kt | 27 +- .../base/analytics/AnalyticsExtensions.kt | 4 +- .../core/base/analytics/AnalyticsHelper.kt | 2 +- .../base/analytics/NoOpAnalyticsHelper.kt | 2 +- .../core/base/analytics/PerformanceTracker.kt | 4 +- .../base/analytics/StubAnalyticsHelper.kt | 2 +- .../core/base/analytics/TestingUtils.kt | 2 +- .../template/core/base/analytics/UiHelpers.kt | 2 +- .../core/base/analytics/ValidationUtils.kt | 2 +- .../core/base/analytics/di/AnalyticsModule.kt | 2 +- .../analytics/di/AnalyticsModule.desktop.kt | 2 +- .../di/AnalyticsModule.js.kt | 2 +- .../AnalyticsModule.native.kt | 2 +- .../base/analytics/FirebaseAnalyticsHelper.kt | 2 +- .../analytics/di/AnalyticsModule.wasmJs.kt | 2 +- core-base/common/build.gradle.kts | 2 +- .../src/androidMain/AndroidManifest.xml | 2 +- .../core/base/common/Parcelize.android.kt | 2 +- .../base/common/di/CommonModule.android.kt | 2 +- .../common/manager/DispatchManagerImpl.kt | 2 +- .../template/core/base/common/DataState.kt | 2 +- .../core/base/common/DataStateExtensions.kt | 2 +- .../core/base/common/ImageExtension.kt | 2 +- .../template/core/base/common/Parcelize.kt | 2 +- .../core/base/common/di/CommonModule.kt | 2 +- .../base/common/manager/DispatcherManager.kt | 2 +- .../core/base/common/Parcelize.nonAndroid.kt | 2 +- .../base/common/di/CommonModule.nonAndroid.kt | 2 +- .../common/manager/DispatchManagerImpl.kt | 2 +- core-base/database/build.gradle.kts | 2 +- .../core/base/database/AppDatabaseFactory.kt | 2 +- .../template/core/base/database/Room.kt | 2 +- .../core/base/database/TypeConverter.kt | 2 +- .../core/base/database/AppDatabaseFactory.kt | 2 +- .../core/base/database/AppDatabaseFactory.kt | 2 +- .../core/base/database/Room.nonJsCommon.kt | 2 +- .../database/TypeConverter.nonJsCommon.kt | 2 +- core-base/designsystem/build.gradle.kts | 2 +- .../base/designsystem/KptMaterialTheme.kt | 2 +- .../core/base/designsystem/KptTheme.kt | 2 +- .../base/designsystem/KptThemeExtensions.kt | 2 +- .../designsystem/component/BounceAnimation.kt | 2 +- .../component/KptAnimationSpecs.kt | 2 +- .../component/KptShimmerLoadingBox.kt | 2 +- .../designsystem/component/KptSnackbarHost.kt | 2 +- .../designsystem/component/KptTopAppBar.kt | 2 +- .../designsystem/component/SlideTransition.kt | 2 +- .../designsystem/core/ComponentStateHolder.kt | 2 +- .../base/designsystem/core/KptComponent.kt | 2 +- .../core/KptTopAppBarConfiguration.kt | 2 +- .../layout/AdaptiveListDetailPaneScaffold.kt | 2 +- .../AdaptiveNavigableListDetailScaffold.kt | 2 +- ...AdaptiveNavigableSupportingPaneScaffold.kt | 2 +- .../layout/AdaptiveNavigationSuiteScaffold.kt | 2 +- .../base/designsystem/layout/KptFlowColumn.kt | 2 +- .../base/designsystem/layout/KptFlowRow.kt | 2 +- .../core/base/designsystem/layout/KptGrid.kt | 2 +- .../designsystem/layout/KptMasonryGrid.kt | 2 +- .../layout/KptResponsiveLayout.kt | 2 +- .../designsystem/layout/KptSidebarLayout.kt | 2 +- .../base/designsystem/layout/KptSplitPane.kt | 2 +- .../core/base/designsystem/layout/KptStack.kt | 2 +- .../designsystem/theme/KptColorSchemeImpl.kt | 2 +- core-base/network/build.gradle.kts | 4 +- .../base/network/KtorHttpClient.android.kt | 18 + .../core/base/network/KtorHttpClient.kt | 162 +++++ .../core/base/network/NetworkError.kt | 58 ++ .../core/base/network/NetworkResult.kt | 39 ++ .../factory/ResultSuspendConverterFactory.kt | 118 ++++ .../base/network/KtorHttpClient.desktop.kt | 18 + .../core/base/network/KtorHttpClient.js.kt | 18 + .../base/network/KtorHttpClient.native.kt | 18 + .../base/network/KtorHttpClient.wasmJs.kt | 18 + core-base/platform/build.gradle.kts | 2 +- .../platform/LocalManagerProviders.android.kt | 2 +- .../platform/context/AppContext.android.kt | 2 +- .../GarbageCollectionManager.android.kt | 2 +- .../base/platform/intent/IntentManagerImpl.kt | 2 +- .../platform/review/AppReviewManagerImpl.kt | 2 +- .../platform/update/AppUpdateManagerImpl.kt | 2 +- .../base/platform/utils/AndroidBuildUtils.kt | 2 +- .../base/platform/LocalManagerProviders.kt | 2 +- .../core/base/platform/context/AppContext.kt | 2 +- .../core/base/platform/di/PlatformModule.kt | 2 +- .../garbage/GarbageCollectionManager.kt | 2 +- .../garbage/GarbageCollectionManagerImpl.kt | 2 +- .../base/platform/intent/IntentManager.kt | 2 +- .../core/base/platform/model/MimeType.kt | 2 +- .../base/platform/review/AppReviewManager.kt | 2 +- .../base/platform/update/AppUpdateManager.kt | 2 +- .../platform/LocalManagerProviders.native.kt | 2 +- .../platform/context/AppContext.native.kt | 2 +- .../GarbageCollectionManager.nonAndroid.kt | 2 +- .../base/platform/intent/IntentManagerImpl.kt | 2 +- .../platform/review/AppReviewManagerImpl.kt | 2 +- .../platform/update/AppUpdateManagerImpl.kt | 2 +- core-base/ui/README.md | 29 +- core-base/ui/build.gradle.kts | 2 +- .../core/base/ui/JankStatsExtensions.kt | 2 +- .../core/base/ui/ReportDrawnExt.android.kt | 2 +- .../core/base/ui/ShareUtils.android.kt | 71 ++- .../template/core/base/ui/BackgroundEvent.kt | 2 +- .../template/core/base/ui/BaseViewModel.kt | 2 +- .../template/core/base/ui/EventsEffect.kt | 2 +- .../template/core/base/ui/ImageLoaderExt.kt | 92 ++- .../core/base/ui/JankStatsExtension.kt | 2 +- .../core/base/ui/LifecycleEventEffect.kt | 2 +- .../core/base/ui/NavGraphBuilderExtensions.kt | 2 +- .../template/core/base/ui/ReportDrawnExt.kt | 2 +- .../template/core/base/ui/ShareUtils.kt | 48 +- .../template/core/base/ui/SharedElementExt.kt | 2 +- .../kotlin/template/core/base/ui/StringExt.kt | 2 +- .../template/core/base/ui/Transition.kt | 2 +- .../core/base/ui/ShareUtils.desktop.kt | 69 +- .../template/core/base/ui/ShareUtils.kt | 20 +- .../core/base/ui/ShareUtils.native.kt | 58 +- .../core/base/ui/JankStatsExtension.jvmJs.kt | 2 +- .../core/base/ui/ReportDrawnExt.jvmJs.kt | 2 +- fastlane/AppFile | 14 +- fastlane/FastFile | 457 +++++-------- fastlane/README.md | 44 +- scripts/pre-commit.sh | 7 +- scripts/pre-push.sh | 17 +- 221 files changed, 7676 insertions(+), 1344 deletions(-) create mode 100644 .github/workflows/build-and-deploy-site.yml create mode 100644 .github/workflows/cache-cleanup.yaml create mode 100644 .github/workflows/monthly-version-tag.yml create mode 100644 .run/cmp-android.run.xml create mode 100644 build-logic/convention/src/main/kotlin/DetektConventionPlugin.kt create mode 100644 build-logic/convention/src/main/kotlin/GitHooksConventionPlugin.kt create mode 100644 build-logic/convention/src/main/kotlin/KeystoreManagementConventionPlugin.kt create mode 100644 build-logic/convention/src/main/kotlin/KtlintConventionPlugin.kt create mode 100644 build-logic/convention/src/main/kotlin/SpotlessConventionPlugin.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/AndroidCompose.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/AndroidInstrumentedTests.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/AppBuildType.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/AppFlavor.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/Badging.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/Detekt.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/GradleManagedDevices.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/HierarchyTemplate.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/Jacoco.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/KotlinAndroid.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/KotlinMultiplatform.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/PrintTestApks.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/ProjectExtensions.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/Spotless.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/keystore/BaseKeystoreTask.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/keystore/ConfigurationFileUpdatesTask.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/keystore/ConfigurationValidator.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/keystore/EnvironmentOverrideHandler.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/keystore/KeystoreConfig.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/keystore/KeystoreGenerationTask.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/keystore/KeystoreLogger.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/keystore/SecretsConfig.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/keystore/SecretsEnvParser.kt create mode 100644 build-logic/convention/src/main/kotlin/org/convention/keystore/SecretsEnvUpdateTask.kt create mode 100644 build-logic/convention/src/test/kotlin/org/convention/keystore/ConfigurationFileUpdatesTaskTest.kt create mode 100644 build-logic/convention/src/test/kotlin/org/convention/keystore/KeystoreGenerationTaskTest.kt create mode 100644 build-logic/convention/src/test/kotlin/org/convention/keystore/SecretsEnvParserTest.kt create mode 100644 build-logic/convention/src/test/kotlin/org/convention/keystore/SecretsEnvUpdateTaskTest.kt mode change 100755 => 100644 ci-prepush.sh create mode 100644 cmp-android/src/main/kotlin/cmp/android/app/AppThemeExtensions.kt create mode 100644 cmp-android/src/main/kotlin/cmp/android/app/BuildConfigUtils.kt create mode 100644 cmp-android/src/main/kotlin/cmp/android/app/ConfigurationExtension.kt create mode 100644 cmp-android/src/prod/AndroidManifest.xml create mode 100644 cmp-ios/iosApp.xcodeproj/xcuserdata/skniyajali.xcuserdatad/xcschemes/iosApp.xcscheme create mode 100644 cmp-ios/iosApp.xcodeproj/xcuserdata/skniyajali.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 cmp-ios/iosApp.xcworkspace/xcuserdata/skniyajali.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 core-base/network/src/androidMain/kotlin/template/core/base/network/KtorHttpClient.android.kt create mode 100644 core-base/network/src/commonMain/kotlin/template/core/base/network/KtorHttpClient.kt create mode 100644 core-base/network/src/commonMain/kotlin/template/core/base/network/NetworkError.kt create mode 100644 core-base/network/src/commonMain/kotlin/template/core/base/network/NetworkResult.kt create mode 100644 core-base/network/src/commonMain/kotlin/template/core/base/network/factory/ResultSuspendConverterFactory.kt create mode 100644 core-base/network/src/desktopMain/kotlin/template/core/base/network/KtorHttpClient.desktop.kt create mode 100644 core-base/network/src/jsMain/kotlin/template/core/base/network/KtorHttpClient.js.kt create mode 100644 core-base/network/src/nativeMain/kotlin/template/core/base/network/KtorHttpClient.native.kt create mode 100644 core-base/network/src/wasmJsMain/kotlin/template/core/base/network/KtorHttpClient.wasmJs.kt diff --git a/.github/workflows/build-and-deploy-site.yml b/.github/workflows/build-and-deploy-site.yml new file mode 100644 index 000000000..280e58d83 --- /dev/null +++ b/.github/workflows/build-and-deploy-site.yml @@ -0,0 +1,65 @@ +# This workflow is designed to automate the process of building and deploying a Kotlin/JS web application to GitHub Pages. +# It ensures that whenever changes are merged into the dev branch or when manually triggered, the web application is built, +# packaged, and deployed to the GitHub Pages environment, making it accessible online. + +# Key Features: +# - Automated web application build using Kotlin/JS +# - Deployment to GitHub Pages +# - Supports configurable web project module name +# - Manages deployment concurrency and environment settings +# - Provides secure deployment with proper permissions + +# Prerequisites: +# - Kotlin Multiplatform/JS project configured with Gradle +# - Web module set up for browser distribution +# - Java 17 or compatible version +# - GitHub Pages enabled in repository settings + +# Workflow Configuration: +# - Requires input of `web_package_name` to specify the web project module +# - Uses Windows runner for build process +# - Leverages GitHub Actions for build, pages configuration, and deployment + +# Workflow Triggers: +# - Can be manually called from other workflows +# - Supports workflow_call for reusability across projects + +# Deployment Process: +# 1. Checkout repository code +# 2. Set up Java development environment +# 3. Build Kotlin/JS web application +# 4. Configure GitHub Pages +# 5. Upload built artifacts +# 6. Deploy to GitHub Pages + +# https://github.com/openMF/mifos-x-actionhub/blob/main/.github/workflows/build-and-deploy-site.yaml + +# ############################################################################## +# DON'T EDIT THIS FILE UNLESS NECESSARY # +# ############################################################################## + +name: Build And Deploy Web App + +# Trigger conditions for the workflow +on: + workflow_dispatch: + +# Concurrency settings to manage multiple workflow runs +# This ensures orderly deployment to production environment +concurrency: + group: "web-pages" + cancel-in-progress: false + +permissions: + contents: read # Read repository contents + pages: write # Write to GitHub Pages + id-token: write # Write authentication tokens + pull-requests: write # Write to pull requests + +jobs: + build_and_deploy_web: + name: Build And Deploy Web App + uses: openMF/mifos-x-actionhub/.github/workflows/build-and-deploy-site.yaml@v1.0.2 + secrets: inherit + with: + web_package_name: 'cmp-web' # <-- Change with your web package name diff --git a/.github/workflows/cache-cleanup.yaml b/.github/workflows/cache-cleanup.yaml new file mode 100644 index 000000000..02685f363 --- /dev/null +++ b/.github/workflows/cache-cleanup.yaml @@ -0,0 +1,15 @@ +name: Cleanup Cache + +on: + pull_request: + types: [ closed ] + workflow_dispatch: + +jobs: + cleanup: + uses: openMF/mifos-x-actionhub/.github/workflows/cache-cleanup.yaml@v1.0.2 + with: + cleanup_pr: ${{ github.event_name == 'pull_request' && github.event.repository.private == true }} + cleanup_all: ${{ github.event_name == 'workflow_dispatch' }} + secrets: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/monthly-version-tag.yml b/.github/workflows/monthly-version-tag.yml new file mode 100644 index 000000000..e96c13615 --- /dev/null +++ b/.github/workflows/monthly-version-tag.yml @@ -0,0 +1,66 @@ +# Automated Monthly Release Versioning Workflow +# ============================================ + +# Purpose: +# - Automatically create consistent monthly version tags +# - Implement a calendar-based versioning strategy +# - Facilitate easy tracking of monthly releases + +# Versioning Strategy: +# - Tag format: YYYY.MM.0 (e.g., 2024.01.0 for January 2024) +# - First digit: Full year +# - Second digit: Month (01-12) +# - Third digit: Patch version (starts at 0, allows for potential updates) + +# Key Features: +# - Runs automatically on the first day of each month at 3:30 AM UTC +# - Can be manually triggered via workflow_dispatch +# - Uses GitHub Actions to generate tags programmatically +# - Provides a predictable and systematic versioning approach + +# Prerequisites: +# - Repository configured with GitHub Actions +# - Permissions to create tags +# - Access to actions/checkout and tag creation actions + +# Workflow Triggers: +# - Scheduled monthly run +# - Manual workflow dispatch +# - Callable from other workflows + +# Actions Used: +# 1. actions/checkout@v4 - Checks out repository code +# 2. josStorer/get-current-time - Retrieves current timestamp +# 3. rickstaa/action-create-tag - Creates Git tags + +# Example Generated Tags: +# - 2024.01.0 (January 2024 initial release) +# - 2024.02.0 (February 2024 initial release) +# - 2024.02.1 (Potential patch for February 2024) + +# https://github.com/openMF/mifos-x-actionhub/blob/main/.github/workflows/monthly-version-tag.yaml + +# ############################################################################## +# DON'T EDIT THIS FILE UNLESS NECESSARY # +# ############################################################################## + +name: Tag Monthly Release + +on: + # Allow manual triggering of the workflow + workflow_dispatch: + # Schedule the workflow to run monthly + schedule: + # Runs at 03:30 UTC on the first day of every month + # Cron syntax: minute hour day-of-month month day-of-week + - cron: '30 3 1 * *' + +concurrency: + group: "monthly-release" + cancel-in-progress: false + +jobs: + monthly_release: + name: Tag Monthly Release + uses: openMF/mifos-x-actionhub/.github/workflows/monthly-version-tag.yaml@v1.0.2 + secrets: inherit diff --git a/.github/workflows/multi-platform-build-and-publish.yml b/.github/workflows/multi-platform-build-and-publish.yml index 9d256dd3e..95eb380b9 100644 --- a/.github/workflows/multi-platform-build-and-publish.yml +++ b/.github/workflows/multi-platform-build-and-publish.yml @@ -71,7 +71,7 @@ on: target_branch: type: string - default: 'development' + default: 'dev' description: 'Target branch for release' distribute_ios_firebase: @@ -89,16 +89,6 @@ on: default: false description: Distribute iOS App to Appstore - distribute_macos_testflight: - type: boolean - default: false - description: Distribute macOS App via TestFlight (App Store Connect) - - distribute_macos_appstore: - type: boolean - default: false - description: Distribute macOS App to Appstore - permissions: contents: write id-token: write @@ -111,32 +101,27 @@ concurrency: jobs: multi_platform_build_and_publish: name: Multi-Platform Build and Publish - uses: openMF/mifos-x-actionhub/.github/workflows/multi-platform-build-and-publish.yaml@v1.0.7 + uses: openMF/mifos-x-actionhub/.github/workflows/multi-platform-build-and-publish.yaml@v1.0.3 with: - java-version: 21 release_type: ${{ inputs.release_type }} target_branch: ${{ inputs.target_branch }} - android_package_name: 'cmp-android' - ios_package_name: 'cmp-ios' - desktop_package_name: 'cmp-desktop' - web_package_name: 'cmp-web' - tester_groups: 'mifos-mobile-apps' - app_identifier: 'org.mifos.mobile' + android_package_name: 'cmp-android' # <-- Change this to your android package name + ios_package_name: 'cmp-ios' # <-- Change this to your ios package name + desktop_package_name: 'cmp-desktop' # <-- Change this to your desktop package name + web_package_name: 'cmp-web' # <-- Change this to your web package name + tester_groups: 'mifos-mobile-apps' # <-- Change this to your Firebase tester group + app_identifier: 'org.mifos.kmp.template' git_url: 'git@github.com:openMF/ios-provisioning-profile.git' - git_branch: 'mifos-mobile' + git_branch: 'master' match_type: 'adhoc' - provisioning_profile_name: 'match AdHoc org.mifos.mobile' - firebase_app_id: '1:728434912738:ios:ee2e0815a6915b351a1dbb' - metadata_path: './fastlane/metadata/ios' + provisioning_profile_name: 'match AdHoc org.mifos.kmp.template' + firebase_app_id: '1:728434912738:ios:1d81f8e53ca7a6f31a1dbb' + metadata_path: './fastlane/metadata' use_cocoapods: true # <-- Set to true if using CocoaPods integration for KMP shared_module: ':cmp-shared' # <-- Gradle path to your shared KMP module (e.g., :shared) - cmp_desktop_dir: 'cmp-desktop' - keychain_name: signing.keychain-db # optional distribute_ios_firebase: ${{ inputs.distribute_ios_firebase }} distribute_ios_testflight: ${{ inputs.distribute_ios_testflight }} distribute_ios_appstore: ${{ inputs.distribute_ios_appstore }} - distribute_macos_testflight: ${{ inputs.distribute_macos_testflight }} - distribute_macos_appstore: ${{ inputs.distribute_macos_appstore }} secrets: original_keystore_file: ${{ secrets.ORIGINAL_KEYSTORE_FILE }} original_keystore_file_password: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }} @@ -151,12 +136,6 @@ jobs: notarization_apple_id: ${{ secrets.NOTARIZATION_APPLE_ID }} notarization_password: ${{ secrets.NOTARIZATION_PASSWORD }} notarization_team_id: ${{ secrets.NOTARIZATION_TEAM_ID }} - keychain_password: ${{ secrets.KEYCHAIN_PASSWORD }} - certificates_password: ${{ secrets.CERTIFICATES_PASSWORD }} - mac_app_distribution_certificate_b64: ${{ secrets.MAC_APP_DISTRIBUTION_CERTIFICATE_B64 }} - mac_installer_distribution_certificate_b64: ${{ secrets.MAC_INSTALLER_DISTRIBUTION_CERTIFICATE_B64 }} - mac_embedded_provision_b64: ${{ secrets.MAC_EMBEDDED_PROVISION_B64 }} - mac_runtime_provision_b64: ${{ secrets.MAC_RUNTIME_PROVISION_B64 }} appstore_key_id: ${{ secrets.APPSTORE_KEY_ID }} appstore_issuer_id: ${{ secrets.APPSTORE_ISSUER_ID }} appstore_auth_key: ${{ secrets.APPSTORE_AUTH_KEY }} diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 0452cca62..42c3a6665 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -13,7 +13,7 @@ ### Workflow Jobs # 1. **Setup**: Prepares the build environment # - Checks out repository code -# - Sets up Java (configurable; defaults to 17) +# - Sets up Java 17 # - Configures Gradle # - Manages dependency caching # @@ -36,7 +36,7 @@ # - Generates platform-specific executables and packages # ### Prerequisites -# - Java (configurable; default 17) +# - Java 17 # - Gradle # - Configured build scripts for: # - Android module @@ -49,16 +49,10 @@ ### Configuration Parameters # The workflow requires two input parameters: # -# | Parameter | Description | Type | Required | -# |------------------------|------------------------------------|--------|-----------| -# | `android_package_name` | Name of the Android project module | String | Yes | -# | `desktop_package_name` | Name of the Desktop project module | String | Yes | -# |`web_package_name` | Name of the Web (Kotlin/JS) project/module | String | No| -# |`ios_package_name` | Name of the iOS project/module | String | No | -# |`build_ios` | Build iOS targets as part of PR checks | Boolean | No | -# |`use_cocoapods` | Use CocoaPods for iOS integration | Boolean | No | -# |`shared_module | Path of the shared KMP module | String | (required when build_ios=true) | -# |`java-version | Java version to use (configurable; defaults to 17)| No | +# | Parameter | Description | Type | Required | +# |------------------------|------------------------------------|--------|----------| +# | `android_package_name` | Name of the Android project module | String | Yes | +# | `desktop_package_name` | Name of the Desktop project module | String | Yes | # # https://github.com/openMF/mifos-x-actionhub/blob/main/.github/workflows/pr-check.yaml @@ -68,18 +62,18 @@ # ############################################################################## -name: PR Checks for KMP +name: PR Checks # Trigger conditions for the workflow on: push: - branches: [ development ] # Runs on pushes to dev branch + branches: [ dev ] # Runs on pushes to dev branch pull_request: - branches: [ development ] # Runs on pushes to dev branch + branches: [ dev ] # Runs on pushes to dev branch # Concurrency settings to prevent multiple simultaneous workflow runs concurrency: - group: pr-kmp-${{ github.ref }} + group: pr-${{ github.ref }} cancel-in-progress: true # Cancels previous runs if a new one is triggered permissions: @@ -87,9 +81,8 @@ permissions: jobs: pr_checks: - name: PR Checks KMP - uses: openMF/mifos-x-actionhub/.github/workflows/pr-check.yaml@v1.0.7 - secrets: inherit + name: PR Checks + uses: openMF/mifos-x-actionhub/.github/workflows/pr-check.yaml@v1.0.3 with: android_package_name: 'cmp-android' # <-- Change Your Android Package Name desktop_package_name: 'cmp-desktop' # <-- Change Your Desktop Package Name @@ -98,4 +91,3 @@ jobs: build_ios: true # <-- Change to 'false' if you don't want to build iOS use_cocoapods: true shared_module: ':cmp-shared' - java-version: '21' diff --git a/.github/workflows/promote-to-production.yml b/.github/workflows/promote-to-production.yml index 8099c4ffa..081e3d629 100644 --- a/.github/workflows/promote-to-production.yml +++ b/.github/workflows/promote-to-production.yml @@ -43,7 +43,7 @@ # end # ``` -# https://github.com/openMF/mifos-mobile-github-actions/blob/main/.github/workflows/promote-to-production.yaml +# https://github.com/openMF/mifos-x-actionhub/blob/main/.github/workflows/promote-to-production.yaml # ############################################################################## # DON'T EDIT THIS FILE UNLESS NECESSARY # @@ -70,6 +70,6 @@ jobs: # Job to promote app from beta to production in Play Store play_promote_production: name: Promote Beta to Production Play Store - uses: openMF/mifos-x-actionhub/.github/workflows/promote-to-production.yaml@v1.0.7 + uses: openMF/mifos-x-actionhub/.github/workflows/promote-to-production.yaml@v1.0.2 secrets: playstore_creds: ${{ secrets.PLAYSTORECREDS }} diff --git a/.github/workflows/sync-dirs.yaml b/.github/workflows/sync-dirs.yaml index 6a947f649..d8ef43626 100644 --- a/.github/workflows/sync-dirs.yaml +++ b/.github/workflows/sync-dirs.yaml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - ref: development + ref: dev - name: Setup Git config run: | @@ -32,12 +32,14 @@ jobs: - name: Add upstream remote and fetch run: | + set -euo pipefail UPSTREAM="${{ inputs.upstream || 'https://github.com/openMF/kmp-project-template.git' }}" git remote add upstream "$UPSTREAM" || true git fetch upstream || exit 1 - name: Check upstream/dev exists run: | + set -euo pipefail if ! git rev-parse --verify upstream/dev >/dev/null 2>&1; then echo "Error: upstream/dev branch does not exist" exit 1 @@ -45,12 +47,16 @@ jobs: - name: Create and checkout temporary branch run: | + set -euo pipefail TEMP_BRANCH="temp-sync-branch-${{ github.run_number }}" git checkout -b "$TEMP_BRANCH" upstream/dev || exit 1 echo "TEMP_BRANCH=$TEMP_BRANCH" >> $GITHUB_ENV - name: Sync directories and files + shell: bash run: | + set -euo pipefail + # Declare directories and files to sync DIRS=( "cmp-android" @@ -66,14 +72,14 @@ jobs: ".github" ".run" ) - + FILES=( "Gemfile" "Gemfile.lock" "ci-prepush.bat" "ci-prepush.sh" ) - + # Define exclusions declare -A EXCLUSIONS=( ["cmp-android"]="src/main/res dependencies src/main/ic_launcher-playstore.png google-services.json" @@ -82,25 +88,27 @@ jobs: ["cmp-ios"]="iosApp/Assets.xcassets" ["root"]="secrets.env" ) - + # Function to check if path should be excluded should_exclude() { local dir=$1 local path=$2 - - # Check for root exclusions - if [[ "$dir" == "." && -n "${EXCLUSIONS["root"]}" ]]; then - local root_excluded_paths=(${EXCLUSIONS["root"]}) + + # Check for root exclusions (when dir is "." or "root") + if [[ "$dir" == "." || "$dir" == "root" ]] && [[ -v "EXCLUSIONS[root]" ]]; then + local root_excluded_paths + IFS=' ' read -ra root_excluded_paths <<< "${EXCLUSIONS[root]}" for excluded in "${root_excluded_paths[@]}"; do if [[ "$path" == *"$excluded"* ]]; then return 0 fi done fi - + # Check directory-specific exclusions - if [[ -n "${EXCLUSIONS[$dir]}" ]]; then - local excluded_paths=(${EXCLUSIONS[$dir]}) + if [[ -v "EXCLUSIONS[$dir]" ]]; then + local excluded_paths + IFS=' ' read -ra excluded_paths <<< "${EXCLUSIONS[$dir]}" for excluded in "${excluded_paths[@]}"; do if [[ "$path" == *"$excluded"* ]]; then return 0 @@ -109,29 +117,31 @@ jobs: fi return 1 } - + # Function to preserve excluded paths preserve_excluded() { local dir=$1 - if [[ -n "${EXCLUSIONS[$dir]}" ]]; then - local excluded_paths=(${EXCLUSIONS[$dir]}) + if [[ -v "EXCLUSIONS[$dir]" ]]; then + local excluded_paths + IFS=' ' read -ra excluded_paths <<< "${EXCLUSIONS[$dir]}" for excluded in "${excluded_paths[@]}"; do local full_path="$dir/$excluded" if [[ -e "$full_path" ]]; then echo "Preserving excluded path: $full_path" local temp_path="temp_excluded/$full_path" mkdir -p "$(dirname "$temp_path")" - cp -r "$full_path" "$(dirname "$temp_path")" + cp -r "$full_path" "$(dirname "$temp_path")/" fi done fi } - + # Function to restore excluded paths restore_excluded() { local dir=$1 - if [[ -n "${EXCLUSIONS[$dir]}" ]]; then - local excluded_paths=(${EXCLUSIONS[$dir]}) + if [[ -v "EXCLUSIONS[$dir]" ]]; then + local excluded_paths + IFS=' ' read -ra excluded_paths <<< "${EXCLUSIONS[$dir]}" for excluded in "${excluded_paths[@]}"; do local full_path="$dir/$excluded" local temp_path="temp_excluded/$full_path" @@ -139,16 +149,17 @@ jobs: echo "Restoring excluded path: $full_path" mkdir -p "$(dirname "$full_path")" rm -rf "$full_path" - cp -r "$temp_path" "$(dirname "$full_path")" + cp -r "$temp_path" "$(dirname "$full_path")/" fi done fi } - + # Function to preserve root-level excluded files preserve_root_files() { - if [[ -n "${EXCLUSIONS["root"]}" ]]; then - local excluded_paths=(${EXCLUSIONS["root"]}) + if [[ -v "EXCLUSIONS[root]" ]]; then + local excluded_paths + IFS=' ' read -ra excluded_paths <<< "${EXCLUSIONS[root]}" for excluded in "${excluded_paths[@]}"; do if [[ -e "$excluded" ]]; then echo "Preserving root-level excluded file: $excluded" @@ -158,11 +169,12 @@ jobs: done fi } - + # Function to restore root-level excluded files restore_root_files() { - if [[ -n "${EXCLUSIONS["root"]}" ]]; then - local excluded_paths=(${EXCLUSIONS["root"]}) + if [[ -v "EXCLUSIONS[root]" ]]; then + local excluded_paths + IFS=' ' read -ra excluded_paths <<< "${EXCLUSIONS[root]}" for excluded in "${excluded_paths[@]}"; do if [[ -e "temp_excluded/root/$excluded" ]]; then echo "Restoring root-level excluded file: $excluded" @@ -171,63 +183,81 @@ jobs: done fi } - + # Create temp directory for exclusions mkdir -p temp_excluded - + # Preserve root-level exclusions before sync preserve_root_files - - # Switch to development branch - git checkout development - + + # Switch to dev branch + git checkout dev + # Sync directories for dir in "${DIRS[@]}"; do - if [ ! -d "$dir" ]; then + if [[ ! -d "$dir" ]]; then echo "Creating $dir..." mkdir -p "$dir" fi - + # Preserve excluded paths before sync if [[ -d "$dir" ]]; then preserve_excluded "$dir" fi - + echo "Syncing $dir..." - git checkout "${{ env.TEMP_BRANCH }}" -- "$dir" || exit 1 - + if ! git checkout "${{ env.TEMP_BRANCH }}" -- "$dir" 2>/dev/null; then + echo "Warning: Could not sync directory $dir (may not exist in upstream)" + fi + # Restore excluded paths after sync restore_excluded "$dir" done - + # Sync files for file in "${FILES[@]}"; do - dir=$(dirname "$file") - if ! should_exclude "$dir" "$file"; then - echo "Syncing $file..." - git checkout "${{ env.TEMP_BRANCH }}" -- "$file" || true - else + file_dir=$(dirname "$file") + file_name=$(basename "$file") + + # Check root exclusions for root-level files + if [[ "$file_dir" == "." ]]; then + if should_exclude "root" "$file_name"; then + echo "Skipping excluded file: $file" + continue + fi + elif should_exclude "$file_dir" "$file"; then echo "Skipping excluded file: $file" + continue + fi + + echo "Syncing $file..." + if ! git checkout "${{ env.TEMP_BRANCH }}" -- "$file" 2>/dev/null; then + echo "Warning: Could not sync file $file (may not exist in upstream)" fi done - + # Restore root-level excluded files restore_root_files - + # Cleanup temp directory rm -rf temp_excluded + echo "Sync completed successfully!" + - name: Clean up temporary branch if: always() - run: git branch -D "${{ env.TEMP_BRANCH }}" || true + run: git branch -D "${{ env.TEMP_BRANCH }}" 2>/dev/null || true - name: Check for changes id: check_changes run: | if [[ -n "$(git status --porcelain)" ]]; then echo "has_changes=true" >> $GITHUB_OUTPUT + echo "Changes detected:" + git status --short else echo "has_changes=false" >> $GITHUB_OUTPUT + echo "No changes detected" fi - name: Create Pull Request @@ -239,35 +269,37 @@ jobs: title: "chore: Sync directories and files from upstream" body: | Automated sync of directories and files from upstream repository. - + Changes included in this sync: - - Directories: + + **Directories:** - cmp-android (excluding src/main/res, dependencies, ic_launcher-playstore.png, google-services.json) - cmp-desktop (excluding icons) - cmp-ios (excluding iosApp/Assets.xcassets) - cmp-web (excluding src/jsMain/resources, src/wasmJsMain/resources) - cmp-shared + - core-base - build-logic - fastlane - scripts - config - .github - .run - - Files: + + **Files:** - Gemfile - Gemfile.lock - ci-prepush.bat - ci-prepush.sh - - Root-level exclusions: + + **Root-level exclusions:** - secrets.env - + + --- Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} branch: sync-dirs-${{ github.run_number }} delete-branch: true labels: | sync automated pr - base: development \ No newline at end of file + base: dev diff --git a/.github/workflows/tag-weekly-release.yml b/.github/workflows/tag-weekly-release.yml index cd90ab15f..9607410db 100644 --- a/.github/workflows/tag-weekly-release.yml +++ b/.github/workflows/tag-weekly-release.yml @@ -1,29 +1,104 @@ +# Weekly Release Tagging and Beta Deployment Workflow +# =================================================== + +# Purpose: +# - Automate weekly version tagging for consistent software versioning +# - Trigger automated beta releases across multiple platforms +# - Maintain a predictable release cycle + +# Workflow Overview: +# - Runs automatically every Sunday at 4:00 AM UTC +# - Supports manual triggering via workflow_dispatch +# - Utilizes Gradle Reckon plugin for intelligent versioning +# - Triggers multi-platform build and publish workflow + +# Key Features: +# - Automatic semantic versioning +# - Cross-platform release automation +# - Configurable target branch for releases +# - Full repository history checkout for accurate versioning + +# Versioning Strategy: +# - Uses Reckon Gradle plugin for semantic versioning +# - Generates production-ready (final) version tags +# - Provides consistent and predictable version incrementation + +# Release Process: +# 1. Checkout repository with full commit history +# 2. Setup Java 17 development environment +# 3. Create and push new version tag +# 4. Trigger multi-platform build and publish workflow + +# Prerequisites: +# - Gradle project configured with Reckon plugin +# - Java 17 development environment +# - Configured multi-platform build workflow +# - GitHub Actions permissions for workflow dispatch + +# Workflow Inputs: +# - target_branch: Branch to use for releases (default: 'dev') +# Allows flexible release targeting across different branches + +# Security Considerations: +# - Uses GitHub's native GITHUB_TOKEN for authentication +# - Controlled workflow dispatch with specific inputs +# - Limited to authorized repository members + +# Potential Use Cases: +# - Regular software release cycles +# - Automated beta testing distributions +# - Consistent multi-platform deployment + +# Workflow Triggers: +# - Scheduled weekly run (Sunday 4:00 AM UTC) +# - Manual workflow dispatch +# - Callable from other workflows + +# ############################################################################## +# DON'T EDIT THIS FILE UNLESS NECESSARY # +# ############################################################################## + name: Tag Weekly Release on: + # Allow manual triggering of the workflow workflow_dispatch: + # Schedule the workflow to run weekly schedule: + # Runs at 04:00 UTC every Sunday + # Cron syntax: minute hour day-of-month month day-of-week - cron: '0 4 * * 0' + +concurrency: + group: "weekly-release" + cancel-in-progress: false + jobs: tag: name: Tag Weekly Release runs-on: ubuntu-latest steps: + # Checkout the repository with full history for proper versioning - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK 21 + # Setup Java environment for Gradle operations + - name: Set up JDK 17 uses: actions/setup-java@v4.2.2 with: distribution: 'temurin' - java-version: '21' + java-version: '17' + # Create and push a new version tag using Reckon + # This uses the 'final' stage for production-ready releases - name: Tag Weekly Release env: - GITHUB_TOKEN: ${{ secrets.TAG_PUSH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./gradlew :reckonTagPush -Preckon.stage=final + # Trigger the build and publish workflow for beta release + # This starts the process of building and deploying the app to various platforms - name: Trigger Workflow uses: actions/github-script@v7 with: @@ -31,9 +106,10 @@ jobs: github.rest.actions.createWorkflowDispatch({ owner: context.repo.owner, repo: context.repo.repo, - workflow_id: 'android-release.yml', - ref: 'development', + workflow_id: 'multi-platform-build-and-publish.yml', + ref: 'dev', inputs: { "release_type": "beta", }, - }) \ No newline at end of file + }) + diff --git a/.run/cmp-android.run.xml b/.run/cmp-android.run.xml new file mode 100644 index 000000000..3750e7d07 --- /dev/null +++ b/.run/cmp-android.run.xml @@ -0,0 +1,74 @@ + + + + + \ No newline at end of file diff --git a/.run/cmp-desktop.run.xml b/.run/cmp-desktop.run.xml index 88186e065..32bd0b3af 100644 --- a/.run/cmp-desktop.run.xml +++ b/.run/cmp-desktop.run.xml @@ -1,11 +1,6 @@ -