Fastlane
Fastlane adalah tool automasi untuk build, test, dan deploy aplikasi mobile.
Setup
# Install
brew install fastlane
# Init di project
cd android # atau ios
fastlane init
Contoh Fastfile (Android)
# android/fastlane/Fastfile
default_platform(:android)
platform :android do
desc "Run unit tests"
lane :test do
gradle(task: "test")
end
desc "Build and distribute to Firebase"
lane :beta do
gradle(
task: "assemble",
build_type: "Release"
)
firebase_app_distribution(
app: ENV["FIREBASE_APP_ID"],
groups: "qa-testers",
release_notes: changelog_from_git_commits
)
end
desc "Deploy to Play Store (internal track)"
lane :deploy do
gradle(
task: "bundle",
build_type: "Release"
)
upload_to_play_store(
track: "internal",
aab: "app/build/outputs/bundle/release/app-release.aab"
)
end
end
Contoh Fastfile (iOS)
# ios/fastlane/Fastfile
default_platform(:ios)
platform :ios do
desc "Build and distribute to TestFlight"
lane :beta do
increment_build_number
build_app(
scheme: "AppName",
export_method: "app-store"
)
upload_to_testflight(
skip_waiting_for_build_processing: true
)
end
desc "Deploy to App Store"
lane :release do
build_app(scheme: "AppName")
upload_to_app_store(
force: true,
submit_for_review: true
)
end
end
Recommended Lanes
| Lane | Deskripsi | Trigger |
|---|---|---|
test | Jalankan unit test | Setiap MR |
beta | Build + distribute ke tester | Merge ke develop |
deploy | Upload ke store (internal) | Merge ke release/* |
release | Submit ke store review | Merge ke main |