Skip to content

Instantly share code, notes, and snippets.

@rodydavis
Last active October 17, 2019 07:32
Show Gist options
  • Save rodydavis/720e5c6b60e2fee80eced028e3b8d8bd to your computer and use it in GitHub Desktop.
Save rodydavis/720e5c6b60e2fee80eced028e3b8d8bd to your computer and use it in GitHub Desktop.
Flutter Fastfile for iOS
# update_fastlane(nightly: true)
default_platform(:ios)
STORE_NAME = 'ci_keychain'
before_all do
xcode_select "/Applications/Xcode.app"
if is_ci?
setup_ci(force: true)
STORE_PWD = 'FlutterRocks'
create_keychain(
name: STORE_NAME,
password: STORE_PWD,
# default_keychain: true,
unlock: true,
timeout: 3600,
lock_when_sleeps: true
)
match(
type: "appstore",
readonly: is_ci,
keychain_name: STORE_NAME,
keychain_password: STORE_PWD,
shallow_clone: true
)
end
end
after_all do
if is_ci?
delete_keychain(
name: STORE_NAME
)
end
end
platform :ios do
desc "Prepare and archive app"
lane :prepare do |options|
Dir.chdir "../.." do
sh("flutter", "packages", "get")
sh("flutter", "clean")
sh("flutter", "build", "ios", "--release", "--no-codesign")
end
build_ios_app(
workspace: "Runner.xcworkspace",
scheme: "Runner"
)
end
desc "Push a new beta build to TestFlight"
lane :beta do
prepare(release: false)
pilot(
changelog: changelog_from_git_commits,
skip_waiting_for_build_processing: true
)
add_git_tag(
grouping: "fastlane-builds",
prefix: "v",
build_number: get_build_number
)
end
desc "Push a new release build to the App Store"
lane :release do
prepare(release: true)
deliver(
submit_for_review: true,
automatic_release: true,
skip_screenshots: true,
force: true
)
add_git_tag(
grouping: "release",
prefix: "v",
build_number: get_version_number
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment