diff --git a/.github/workflows/build-and-deploy-site.yml b/.github/workflows/build-and-deploy-site.yml new file mode 100644 index 0000000000..280e58d834 --- /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 0000000000..02685f3631 --- /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 0000000000..e96c136151 --- /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 9d256dd3e4..95eb380b9d 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 0452cca62e..42c3a6665f 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 8099c4ffa6..081e3d629f 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 996e95e55d..b71f8ed3c6 100644 --- a/.github/workflows/sync-dirs.yaml +++ b/.github/workflows/sync-dirs.yaml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - ref: development + ref: dev - name: Setup Git config run: | @@ -176,8 +176,8 @@ jobs: # 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 @@ -200,7 +200,7 @@ jobs: # Sync files for file in "${FILES[@]}"; do - dir=$(dirname "$file") + local dir=$(dirname "$file") if ! should_exclude "$dir" "$file"; then echo "Syncing $file..." git checkout "${{ env.TEMP_BRANCH }}" -- "$file" || true @@ -268,4 +268,4 @@ jobs: labels: | sync automated pr - base: development \ No newline at end of file + base: dev \ No newline at end of file diff --git a/.github/workflows/tag-weekly-release.yml b/.github/workflows/tag-weekly-release.yml index cd90ab15fd..9607410dbc 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 0000000000..3750e7d078 --- /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 88186e065a..32bd0b3af3 100644 --- a/.run/cmp-desktop.run.xml +++ b/.run/cmp-desktop.run.xml @@ -1,11 +1,6 @@ -