Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GillesVercammen/06feb79057dec29af91f0f949d1768c3 to your computer and use it in GitHub Desktop.
Save GillesVercammen/06feb79057dec29af91f0f949d1768c3 to your computer and use it in GitHub Desktop.
fastlane android
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform :android
before_all do
update_fastlane
dependencies
end
platform :android do
private_lane :clean_android do
gradle(task: 'clean', project_dir: "./")
end
# DEV LANE
desc "Clean, build development"
lane :dev do |options|
if options[:clean]
clean_android
end
rntest
test
gradle(
task: "assemble",
build_type: "debug",
project_dir: "./"
)
end
# STAGING LANE
desc "Clean, build, and push a staging release to Fabric"
lane :beta do |options|
if options[:clean]
clean_android
end
# build the release staging variant
gradle(
task: "assemble",
build_type: "staging",
project_dir: "./"
)
submit_fabric_beta
end
# RELEASE LANE
desc "Clean, build, and push a release to the alpha track on Google Play Dev Console"
lane :release do |options|
clean_android
# build the release variant
gradle(
task: "assemble",
build_type: "release",
project_dir: "./")
end
# TEST LANE
desc "Runs all the tests"
lane :test do
gradle(task: "testDebug")
end
# REACT NATIVE TEST LANE
desc "Runs all the React Native tests"
lane :rntest do
sh("npm", "test")
end
# SEPERATE COMMAND FOR CRASHLYTICS BETA
desc "distribute to Crashlytics Beta"
private_lane :submit_fabric_beta do
crashlytics(
api_token: ENV["CRASHLYTICS_API_TOKEN"],
build_secret: ENV["CRASHLYTICS_BUILD_SECRET"],
notifications: false,
groups: ["af-android", "af-stage"],
apk_path: "./app/build/outputs/apk/app-staging.apk"
)
end
desc "Deploy a new version to the Google Play"
lane :deploy do
gradle(task: "clean assembleRelease")
upload_to_play_store
end
desc "Debug build"
lane :debugBuild do
gradle(task: "assembleDebug")
end
desc "Dependencies for before all"
lane :dependencies do
sh("npm","install")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment