# Customise this file, documentation can be found here: # https://github.com/fastlane/fastlane/tree/master/fastlane/docs # All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md # can also be listed using the `fastlane actions` command # Change the syntax highlighting to Ruby # All lines starting with a # are ignored when running `fastlane` # If you want to automatically update fastlane if a new version is available: # update_fastlane # This is the minimum version number required. # Update this, if you use features of a newer version fastlane_version "2.62.1" default_platform :android platform :android do before_all do # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..." end desc "Runs all the tests" lane :test do gradle(task: "test") end desc "Build the apk" lane :build do gradle( task: "clean assemble", build_type: 'Release' ) end desc "Bump version code/build number" private_lane :bump do increment_version_code( var_name: "versionCode|versionBuild", verbose: true, ) end desc "Tag as a new version" private_lane :tag do git_commit( path: "app/build.gradle", message: "Increment version code to #{lane_context[SharedValues::VERSION_CODE]} for next release", ) add_git_tag( tag: "#{ENV['VERSION']}-#{lane_context[SharedValues::VERSION_CODE]}", message: "Create new tag for version #{ENV['VERSION']}-#{lane_context[SharedValues::VERSION_CODE]}", ) push_to_git_remote( local_branch: "HEAD", remote_branch: "master", ) end desc "Build and deploy the apk for Alpha testing in Google Play store" lane :deploy_alpha do bump gradle( task: "clean assemble", build_type: 'Release', ) sh("cp -vf metadata/android/en-US/changelogs/latest.txt metadata/android/en-US/changelogs/#{lane_context[SharedValues::VERSION_CODE]}.txt") sh("git add metadata/android/en-US/changelogs/#{lane_context[SharedValues::VERSION_CODE]}.txt") sh("git add metadata/android/en-US/changelogs/latest.txt") sh("cp -vf metadata/android/nl-NL/changelogs/latest.txt metadata/android/nl-NL/changelogs/#{lane_context[SharedValues::VERSION_CODE]}.txt") sh("git add metadata/android/nl-NL/changelogs/#{lane_context[SharedValues::VERSION_CODE]}.txt") sh("git add metadata/android/nl-NL/changelogs/latest.txt") git_commit( path: [ "fastlane/metadata/android/en-US/changelogs/latest.txt", "fastlane/metadata/android/en-US/changelogs/#{lane_context[SharedValues::VERSION_CODE]}.txt", "fastlane/metadata/android/nl-NL/changelogs/latest.txt", "fastlane/metadata/android/nl-NL/changelogs/#{lane_context[SharedValues::VERSION_CODE]}.txt", ], message: "Provide changelogs for this version", ) supply( apk: 'app/build/outputs/apk/app-release.apk', mapping: 'app/build/outputs/apk/mapping.txt', track: 'alpha', skip_upload_apk: false, skip_upload_metadata: false, skip_upload_images: true, skip_upload_screenshots: true, ) tag end desc "Update metadata only, including images and screenshots" lane :deploy_metadata do supply( skip_upload_apk: true, skip_upload_metadata: false, skip_upload_images: false, skip_upload_screenshots: false, ) end desc "Submit a new Beta Build to Crashlytics Beta" lane :beta do gradle(task: "assembleRelease") crashlytics # sh "your_script.sh" # You can also use other beta testing services here end desc "Deploy a new version to the Google Play" lane :deploy do #gradle(task: "assembleRelease") #supply end # You can define as many lanes as you want after_all do |lane| # This block is called, only if the executed lane was successful # slack( # message: "Successfully deployed new App Update." # ) end error do |lane, exception| # slack( # message: exception.message, # success: false # ) end end # More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md # All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md # fastlane reports which actions are used # No personal data is sent or shared. Learn more at https://github.com/fastlane/enhancer