This directory contains Fastlane configuration files for automating iOS and Android deployment processes.
fastlane/
├── Fastfile # Main Fastlane configuration file that imports all lanes
├── configs_example.rb # Example configuration file (for reference)
├── helpers.rb # Helper methods used across lanes
├── common_lanes.rb # Common lanes used by both platforms
├── android_lanes.rb # Android specific lanes
└── ios_lanes.rb # iOS specific lanes
Main configuration file that imports all other lane files. This file serves as an entry point for all Fastlane commands.
Contains environment variables for:
- App Store Connect API credentials
- Google Play Store JSON key path
- Slack webhook URL Note: This file should not be committed to version control.
Example configuration file showing the required environment variables structure. Use this as a template to create your own configs.rb
.
Contains helper methods used across different lanes:
get_flutter_version
: Reads version from pubspec.yamlvalidate_build_options
: Validates Android/iOS build optionsvalidate_ios_build_options
: Validates iOS specific build optionsvalidate_app_store_credentials
: Validates App Store credentials
Contains lanes used by both platforms:
add_git_tag_method
: Adds git tag for releasessend_slack_message
: Sends deployment notifications to Slack
Android specific lanes:
read_version
: Reads version from pubspec.yamlincrement_build_number_lane
: Increments Play Store build numberincrement_firebase_build_number_lane
: Increments Firebase build numberflutter_build
: Builds Android appbuild_store
: Uploads to Play Storeupload_to_firebase
: Uploads to Firebase App Distributiondeploy_android
: Main deployment lane for Play Storedeploy_android_firebase
: Main deployment lane for Firebase
iOS specific lanes:
connect_app_store
: Sets up App Store Connect APIread_and_increment_build_number
: Updates version and build numbersbuild_app_lane
: Builds iOS appupload_to_testflight_lane
: Uploads to TestFlightupload_symbols_to_crashlytics_lane
: Uploads dSYM to Crashlyticsdeploy_ios
: Main deployment lane for TestFlight
Each app in the monorepo can have its own Fastfile and Appfile in their respective directories:
apps/
└── your_app/
├── android/
│ └── fastlane/
│ ├── Fastfile # Android specific configuration
│ └── Appfile # Android credentials and app identifiers
└── ios/
└── fastlane/
├── Fastfile # iOS specific configuration
└── Appfile # iOS credentials and app identifiers
# apps/better_iptv/ios/fastlane/Fastfile
default_platform(:ios)
# Clone the shared Fastfile containing the deploy lane logic
require 'tmpdir'
Dir.mktmpdir do |tmpdir|
clone_folder = File.join(tmpdir, "fastlane-config")
sh("git clone [email protected]:mdikcinar/Fastlane-Configured.git #{clone_folder}")
# Import all required files from the cloned repository
import "#{clone_folder}/Fastfile"
end
# Import configs.rb if you created common one for monorepo or default Appfile will be used
platform :ios do
desc "Deploy production application to TestFlight"
lane :prod do
deploy_ios(
scheme: "production",
app_name: "Example APP",
slack_message: "Example APP iOS: Production app successfully released!",
)
end
end
# apps/example_app/ios/fastlane/Appfile
# If not using common configs.rb, configure app-specific credentials here
ENV['APP_STORE_KEY_ID'] = "Example123"
ENV['APP_STORE_ISSUER_ID'] = "1234567890"
ENV['APP_STORE_KEY_FILENAME'] = "AuthKey_Example123.p8"
ENV['SLACK_URL'] = "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
# You can use environment variables or provide static values
for_platform :ios do
for_lane :prod do
app_identifier 'com.example.exampleapp'
end
for_lane :dev do
app_identifier 'com.example.exampleapp.dev'
end
end
# apps/better_iptv/android/fastlane/Fastfile
default_platform(:android)
# Clone the shared Fastfile containing the deploy lane logic
require 'tmpdir'
Dir.mktmpdir do |tmpdir|
clone_folder = File.join(tmpdir, "fastlane-config")
sh("git clone [email protected]:mdikcinar/Fastlane-Configured.git #{clone_folder}")
# Import all required files from the cloned repository
import "#{clone_folder}/Fastfile"
end
# Import configs.rb if you created common one for monorepo or default Appfile will be used
platform :android do
desc "Deploy production application to Play Store"
lane :prod do
deploy_android(
track: "internal",
app_name: "Example APP",
app_identifier: "com.example.exampleapp",
flavor: "production",
target: "lib/main_production.dart",
slack_message: "Example APP Android: Production app successfully released!"
)
end
desc "Deploy development build to Firebase"
lane :dev do
deploy_android_firebase(
firebase_app_id: "1:1234567890:android:abcdef",
app_identifier: "com.example.exampleapp.dev",
app_name: "Example APP Dev",
flavor: "development",
target: "lib/main_development.dart",
build: "apk",
slack_message: "Example APP Android: Development build uploaded to Firebase!"
)
end
end
# apps/better_iptv/android/fastlane/Appfile
# If not using common configs.rb, configure app-specific credentials here
ENV['JSON_KEY_FILE_PATH'] = "../store_keys/xxx.json"
ENV['SLACK_URL'] = "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
- App-specific Appfile configurations take precedence over common configs
- Environment variables set in the CI/CD pipeline take precedence over both
- If using common configs.rb, Appfile configurations are optional