Skip to content

Commit

Permalink
feat: Bug Fixes & Setup Release Process (#2293)
Browse files Browse the repository at this point in the history
  • Loading branch information
niyajali authored Jan 27, 2025
1 parent 2c3d991 commit c91f980
Show file tree
Hide file tree
Showing 180 changed files with 4,835 additions and 2,785 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# GitHub Actions Workflow for Kotlin Android Application Deployment
#
# OVERVIEW:
# This workflow supports building and publishing applications across multiple platforms:
# - Android (APK/AAB)
#
# PREREQUISITES:
# Ensure your project is configured with:
# - Gradle build system
# - Kotlin Multiplatform Project with Android, iOS, Desktop, and Web modules
# - Fastlane for deployment automation
# - Separate modules/package names for each platform
#
# REQUIRED SECRETS:
# Configure the following secrets in GitHub repository settings:
# - ORIGINAL_KEYSTORE_FILE: Base64 encoded Android release keystore
# - ORIGINAL_KEYSTORE_FILE_PASSWORD: Keystore password
# - ORIGINAL_KEYSTORE_ALIAS: Keystore alias
# - ORIGINAL_KEYSTORE_ALIAS_PASSWORD: Keystore alias password

# - UPLOAD_KEYSTORE_FILE: Base64 encoded Android release keystore
# - UPLOAD_KEYSTORE_FILE_PASSWORD: Keystore password
# - UPLOAD_KEYSTORE_ALIAS: Keystore alias
# - UPLOAD_KEYSTORE_ALIAS_PASSWORD: Keystore alias password

# - GOOGLESERVICES: Google Services configuration JSON
# - PLAYSTORECREDS: Play Store service account credentials
# - FIREBASECREDS: Firebase distribution credentials

# WORKFLOW INPUTS:
# - release_type: 'internal' (default) or 'beta'
# - target_branch: Branch to use for release (default: 'dev')
# - android_package_name: Name of Android module

# USAGE:
# 1. Ensure all required secrets are configured
# 2. Customize package names in workflow inputs
# 3. Toggle platform-specific publishing flags
# 4. Trigger workflow manually or via GitHub Actions UI

# https://github.com/openMF/mifos-mobile-github-actions/blob/main/.github/workflows/android-build-and-publish.yaml

# ##############################################################################
# DON'T EDIT THIS FILE UNLESS NECESSARY #
# ##############################################################################
name: Android Build and Publish

on:
workflow_dispatch:
inputs:
release_type:
type: choice
options:
- internal
- beta
default: internal
description: Release Type

target_branch:
type: string
default: 'development'
description: 'Target branch for release'

permissions:
contents: write
id-token: write
pages: write

concurrency:
group: "reusable"
cancel-in-progress: false

jobs:
android_build_and_publish:
name: Android Build and Publish
uses: openMF/mifos-mobile-github-actions/.github/workflows/android-build-and-publish.yaml@main
with:
release_type: ${{ inputs.release_type }}
target_branch: ${{ inputs.target_branch }}
android_package_name: 'mifosng-android' # <-- Change this to your android package name
tester_groups: 'mifos-mobile-testers' # <-- Change this to your Firebase tester group
secrets:
original_keystore_file: ${{ secrets.ORIGINAL_KEYSTORE_FILE }}
original_keystore_file_password: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }}
original_keystore_alias: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS }}
original_keystore_alias_password: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS_PASSWORD }}

upload_keystore_file: ${{ secrets.UPLOAD_KEYSTORE_FILE }}
upload_keystore_file_password: ${{ secrets.UPLOAD_KEYSTORE_FILE_PASSWORD }}
upload_keystore_alias: ${{ secrets.UPLOAD_KEYSTORE_ALIAS }}
upload_keystore_alias_password: ${{ secrets.UPLOAD_KEYSTORE_ALIAS_PASSWORD }}

google_services: ${{ secrets.GOOGLESERVICES }}
firebase_creds: ${{ secrets.FIREBASECREDS }}
playstore_creds: ${{ secrets.PLAYSTORECREDS }}
token: ${{ secrets.GITHUB_TOKEN }}
66 changes: 66 additions & 0 deletions .github/workflows/monthly-release.yaml
Original file line number Diff line number Diff line change
@@ -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-mobile-github-actions/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-mobile-github-actions/.github/workflows/monthly-version-tag.yaml@main
secrets: inherit
75 changes: 75 additions & 0 deletions .github/workflows/promote-to-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# GitHub Actions Workflow for Play Store Release Promotion
#
# PURPOSE:
# This workflow automates the process of promoting a beta release
# to the production track on Google Play Store.
#
# PREREQUISITES:
# 1. Fastlane setup with Android deployment configurations
# 2. Configured Fastlane lanes:
# - `promote_to_production`: Handles beta to production promotion
#
# REQUIRED CONFIGURATION:
# - Secrets:
# PLAYSTORECREDS: Google Play Store service account JSON credentials
#
# INPUTS:
# - android_package_name: Name of the Android project module
# (REQUIRED, must match your project's module structure)
#
# WORKFLOW TRIGGERS:
# - Can be called manually or triggered by other workflows
# - Typically used after beta testing and validation
#
# DEPLOYMENT PROCESS:
# 1. Checks out repository code
# 2. Sets up Ruby and Fastlane environment
# 3. Inflates Play Store credentials
# 4. Runs Fastlane lane to promote beta to production
#
# IMPORTANT NOTES:
# - Requires proper Fastlane configuration in your project
# - Ensures consistent and automated Play Store deployments
# - Configurable retry mechanism for upload stability
#
# RECOMMENDED FASTLANE LANE IMPLEMENTATION:
# ```ruby
# lane :promote_to_production do
# upload_to_play_store(
# track: 'beta',
# track_promote_to: 'production',
# json_key: './playStorePublishServiceCredentialsFile.json'
# )
# end
# ```

# https://github.com/openMF/mifos-mobile-github-actions/blob/main/.github/workflows/promote-to-production.yaml

# ##############################################################################
# DON'T EDIT THIS FILE UNLESS NECESSARY #
# ##############################################################################

name: Promote Release to Play Store

# Workflow triggers:
# 1. Manual trigger with option to publish to Play Store
# 2. Automatic trigger when a GitHub release is published
on:
workflow_dispatch:
release:
types: [ released ]

concurrency:
group: "production-deploy"
cancel-in-progress: false

permissions:
contents: write

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-mobile-github-actions/.github/workflows/promote-to-production.yaml@main
secrets:
playstore_creds: ${{ secrets.PLAYSTORECREDS }}
43 changes: 43 additions & 0 deletions .github/workflows/upload-demo-app-on-firebase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Upload Demo App on Firebase

on:
workflow_dispatch:
inputs:
tester_groups:
description: 'Comma-separated list of tester groups'
required: true
default: 'mifos-mobile-testers'
type: string

pull_request:
types: [ labeled ]
branches:
- 'development'
- 'master'

concurrency:
group: firebase-${{ github.ref }}
cancel-in-progress: true

jobs:
upload_demo_app_on_firebase:
name: Upload Demo App on Firebase
runs-on: macos-latest
if: github.event.label.name == 'firebase-test-on' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: ☁️ Deploy Android App on Firebase
uses: openMF/kmp-android-firebase-publish-action@v1.0.0
with:
release_type: 'demo'
android_package_name: 'mifosng-android'
keystore_file: ${{ secrets.ORIGINAL_KEYSTORE_FILE }}
keystore_password: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }}
keystore_alias: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS }}
keystore_alias_password: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS_PASSWORD }}
google_services: ${{ secrets.GOOGLESERVICES }}
firebase_creds: ${{ secrets.FIREBASECREDS }}
tester_groups: ${{ inputs.tester_groups }}
39 changes: 39 additions & 0 deletions .github/workflows/weekly-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Tag Weekly Release

on:
workflow_dispatch:
schedule:
- cron: '0 4 * * 0'
jobs:
tag:
name: Tag Weekly Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v4.2.2
with:
distribution: 'temurin'
java-version: '17'

- name: Tag Weekly Release
env:
GITHUB_TOKEN: ${{ secrets.TAG_PUSH_TOKEN }}
run: ./gradlew :reckonTagPush -Preckon.stage=final

- name: Trigger Workflow
uses: actions/github-script@v7
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'android-release.yml',
ref: 'dev',
inputs: {
"release_type": "beta",
},
})
Loading

0 comments on commit c91f980

Please sign in to comment.