Skip to content

Instantly share code, notes, and snippets.

@jogboms
Forked from rodydavis/Fastfile
Created August 10, 2018 08:17
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jogboms/a35b5cdf8eb584320832646e7b0480fc to your computer and use it in GitHub Desktop.
Save jogboms/a35b5cdf8eb584320832646e7b0480fc to your computer and use it in GitHub Desktop.
Top-level Fastfile for Flutter
# 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
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
# Uncomment the line if you want fastlane to automatically update itself
update_fastlane
# default_platform(:android)
app_name = "APP NAME HERE" #{app_name}
project_path = "PROJECT PATH HERE" #{project_path}
username = "APPLE ID HERE" #{username} // Apple ID
platform :android do
desc "Deploy a new version to the Google Play Beta"
lane :beta do
# Return the number of commits in current git branch
#increment_version_code
build_number = number_of_commits(all: true)
changelog_from_git_commits
Dir.chdir ".." do
sh("flutter", "packages", "get")
sh("flutter", "clean")
sh("flutter", "build", "apk", "--build-number=#{build_number}")
end
upload_to_play_store(
track: 'beta',
apk: "#{project_path}/build/app/outputs/apk/release/app-release.apk",
skip_upload_screenshots: true,
skip_upload_images: true)
end
desc "Deploy a new version to the Google Play Production"
lane :release do
# Return the number of commits in current git branch
build_number = number_of_commits(all: true)
changelog_from_git_commits
Dir.chdir ".." do
sh("flutter", "packages", "get")
sh("flutter", "clean")
sh("flutter", "build", "apk", "--build-number=#{build_number}")
end
upload_to_play_store(
track: 'production',
apk: "#{project_path}/build/app/outputs/apk/release/app-release.apk",
skip_upload_screenshots: true,
skip_upload_images: true)
end
end
platform :ios do
desc "Push a new beta build to TestFlight"
lane :beta do
# Return the number of commits in current git branch
build_number = number_of_commits(all: true)
changelog_from_git_commits
Dir.chdir ".." do
sh("flutter", "packages", "get")
sh("flutter", "clean")
sh("flutter", "build", "ios", "--build-number=#{build_number}")
end
build_ios_app(workspace: "#{project_path}/ios/Runner.xcworkspace", scheme: "Runner")
upload_to_testflight(
skip_waiting_for_build_processing: true,
ipa: "#{project_path}/Runner.ipa",
username: username)
end
desc "Push a new release build to the App Store"
lane :release do
# Return the number of commits in current git branch
build_number = number_of_commits(all: true)
changelog_from_git_commits
Dir.chdir ".." do
sh("flutter", "packages", "get")
sh("flutter", "clean")
sh("flutter", "build", "ios", "--build-number=#{build_number}")
end
build_ios_app(workspace: "#{project_path}/ios/Runner.xcworkspace", scheme: "Runner")
upload_to_app_store(
submit_for_review: true,
automatic_release: true,
skip_screenshots: true,
force: true,
skip_waiting_for_build_processing: true,
ipa: "#{project_path}/Runner.ipa",
username: username)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment