Skip to content
Merged
24 changes: 13 additions & 11 deletions fastlane-config/android_config.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
require_relative 'project_config'

module FastlaneConfig
module AndroidConfig
STORE_CONFIG = {
default_store_file: "release_keystore.keystore",
default_store_password: "mifos1234",
default_key_alias: "mifos",
default_key_password: "mifos1234"
default_store_file: ProjectConfig::ANDROID[:keystore][:file],
default_store_password: ProjectConfig::ANDROID[:keystore][:password],
default_key_alias: ProjectConfig::ANDROID[:keystore][:key_alias],
default_key_password: ProjectConfig::ANDROID[:keystore][:key_password]
}

FIREBASE_CONFIG = {
firebase_prod_app_id: "1:728434912738:android:ecdb5b96f0e735661a1dbb",
firebase_demo_app_id: "1:728434912738:android:53d0930e402622611a1dbb",
firebase_service_creds_file: "secrets/firebaseAppDistributionServiceCredentialsFile.json",
firebase_groups: "mifos-mobile-apps"
firebase_prod_app_id: ProjectConfig::ANDROID[:firebase][:prod_app_id],
firebase_demo_app_id: ProjectConfig::ANDROID[:firebase][:demo_app_id],
firebase_service_creds_file: ProjectConfig.firebase_credentials_file,
firebase_groups: ProjectConfig::ANDROID[:firebase][:groups]
}

BUILD_PATHS = {
prod_apk_path: "cmp-android/build/outputs/apk/prod/release/cmp-android-prod-release.apk",
demo_apk_path: "cmp-android/build/outputs/apk/demo/release/cmp-android-demo-release.apk",
prod_aab_path: "cmp-android/build/outputs/bundle/prodRelease/cmp-android-prod-release.aab"
prod_apk_path: ProjectConfig::ANDROID[:apk_paths][:prod],
demo_apk_path: ProjectConfig::ANDROID[:apk_paths][:demo],
prod_aab_path: ProjectConfig::ANDROID[:aab_path]
}
end
end
60 changes: 60 additions & 0 deletions fastlane-config/extract_config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env ruby
# ==============================================================================
# iOS Configuration Extraction Script for GitHub Actions
# ==============================================================================
# This script extracts iOS configuration from project_config.rb and outputs
# it as JSON for consumption by GitHub Actions workflows.
#
# Usage:
# ruby fastlane-config/extract_config.rb
#
# Output:
# JSON object with iOS configuration values
# ==============================================================================

require 'json'
require_relative 'project_config'

begin
# Extract iOS configuration from project_config.rb
config = {
# App-specific configuration (from IOS)
app_identifier: FastlaneConfig::ProjectConfig::IOS[:app_identifier],
firebase_app_id: FastlaneConfig::ProjectConfig::IOS[:firebase][:app_id],
firebase_groups: FastlaneConfig::ProjectConfig::IOS[:firebase][:groups],
metadata_path: FastlaneConfig::ProjectConfig::IOS[:metadata_path],
version_number: FastlaneConfig::ProjectConfig::IOS[:version_number],

# Shared configuration (from IOS_SHARED)
team_id: FastlaneConfig::ProjectConfig::IOS_SHARED[:team_id],
match_git_url: FastlaneConfig::ProjectConfig::IOS_SHARED[:code_signing][:match_git_url],
match_git_branch: FastlaneConfig::ProjectConfig::IOS_SHARED[:code_signing][:match_git_branch],
match_type: FastlaneConfig::ProjectConfig::IOS_SHARED[:code_signing][:match_type],

# Dynamically computed provisioning profiles
provisioning_profile_adhoc: FastlaneConfig::ProjectConfig::IOS_SHARED[:code_signing][:provisioning_profiles][:adhoc],
provisioning_profile_appstore: FastlaneConfig::ProjectConfig::IOS_SHARED[:code_signing][:provisioning_profiles][:appstore]
}

# Output as pretty-printed JSON
puts JSON.pretty_generate(config)

# Exit successfully
exit 0

rescue => e
# Error handling
STDERR.puts "Error extracting iOS configuration:"
STDERR.puts " #{e.class}: #{e.message}"
STDERR.puts
STDERR.puts "Stack trace:"
e.backtrace.each { |line| STDERR.puts " #{line}" }
STDERR.puts
STDERR.puts "Please ensure:"
STDERR.puts " 1. fastlane-config/project_config.rb exists and is valid Ruby"
STDERR.puts " 2. Both IOS and IOS_SHARED configurations are defined"
STDERR.puts " 3. All required keys are present in the configuration"

# Exit with error
exit 1
end
49 changes: 42 additions & 7 deletions fastlane-config/ios_config.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,50 @@
require_relative 'project_config'

module FastlaneConfig
module IosConfig
# Firebase Configuration (reads from IOS)
FIREBASE_CONFIG = {
firebase_app_id: "1:728434912738:ios:shjhsa78392shja",
firebase_service_creds_file: "secrets/firebaseAppDistributionServiceCredentialsFile.json",
firebase_groups: "mifos-mobile-apps"
firebase_app_id: ProjectConfig::IOS[:firebase][:app_id],
firebase_service_creds_file: ProjectConfig.firebase_credentials_file,
firebase_groups: ProjectConfig::IOS[:firebase][:groups]
}

# Build Configuration (reads from both IOS and IOS_SHARED)
BUILD_CONFIG = {
project_path: "cmp-ios/iosApp.xcodeproj",
scheme: "iosApp",
output_directory: "cmp-ios/build"
# App-specific (from IOS)
app_identifier: ProjectConfig::IOS[:app_identifier],
project_path: ProjectConfig::IOS[:project_path],
workspace_path: ProjectConfig::IOS[:workspace_path],
plist_path: ProjectConfig::IOS[:plist_path],
scheme: ProjectConfig::IOS[:scheme],
output_name: ProjectConfig::IOS[:output_name],
output_directory: ProjectConfig::IOS[:output_directory],
version_number: ProjectConfig::IOS[:version_number],
metadata_path: ProjectConfig::IOS[:metadata_path],
app_rating_config_path: ProjectConfig::IOS[:age_rating_config_path],

Comment thread
therajanmaurya marked this conversation as resolved.
# Shared (from IOS_SHARED)
team_id: ProjectConfig::IOS_SHARED[:team_id],
ci_provider: ProjectConfig::IOS_SHARED[:ci_provider],

# App Store Connect API (from IOS_SHARED)
key_id: ProjectConfig::IOS_SHARED[:app_store_connect][:key_id],
issuer_id: ProjectConfig::IOS_SHARED[:app_store_connect][:issuer_id],
key_filepath: ProjectConfig::IOS_SHARED[:app_store_connect][:key_filepath],

# Code Signing & Match (from IOS_SHARED)
match_type: ProjectConfig::IOS_SHARED[:code_signing][:match_type],
match_git_private_key: ProjectConfig::IOS_SHARED[:code_signing][:match_git_private_key],
git_url: ProjectConfig::IOS_SHARED[:code_signing][:match_git_url],
git_branch: ProjectConfig::IOS_SHARED[:code_signing][:match_git_branch],
provisioning_profile_name: ProjectConfig::IOS_SHARED[:code_signing][:provisioning_profiles][:adhoc],
provisioning_profile_appstore: ProjectConfig::IOS_SHARED[:code_signing][:provisioning_profiles][:appstore]
}

# TestFlight Configuration (from IOS_SHARED)
TESTFLIGHT_CONFIG = ProjectConfig::IOS_SHARED[:testflight]

# App Store Configuration (from IOS_SHARED)
APPSTORE_CONFIG = ProjectConfig::IOS_SHARED[:appstore]
end
end
end
Loading