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 @@ -