flutter/examples/flutter_gallery/ios/fastlane/Fastfile
Greg Spencer e60087a1a7
Remove Travis configuration from flutter/flutter (#20288)
This removes the final traces of Travis and Appveyor from the Flutter tree.

I've updated the documentation and fixed a couple of places where scripts look for Travis, and eliminated the dart tools runningOnTravis function (which was unused anyhow).

There are places in the flutter script that used to look for the environment variable TRAVIS. We actually do want to continue to detect that we're running on Travis there, since in the plugins repo we still use Travis (for the moment). In any case, it's OK, because the CI environment variable is set on all of the CI bots (Cirrus, Travis, and Appveyor).

FastLane doesn't have a setup_cirrus equivalent to setup_travis, but it actually doesn't matter there either, since it doesn't do Travis-specific things, and it also looks for the CI environment variable.
2018-08-07 13:41:33 -07:00

84 lines
2.7 KiB
Ruby

# Prevent Fastlane from overwriting README.md
skip_docs
default_platform(:ios)
def suppress_output
original_stdout, original_stderr = $stdout.clone, $stderr.clone
$stderr.reopen File.new('/dev/null', 'w')
$stdout.reopen File.new('/dev/null', 'w')
yield
ensure
$stdout.reopen original_stdout
$stderr.reopen original_stderr
end
# This should be run after running
# flutter build ios --release --no-codesign
# to build the app using the Flutter toolchain. This lane is meant to only
# rebuild the app by:
# 1- Signing using the publishing credentials; and
# 2- xcodebuild with archive option
platform :ios do
desc 'Push a new release to TestFlight'
lane :build_and_deploy_testflight do |options|
# Doesn't do anything when not on a CI bot. Even though it's called
# "setup_travis", this also runs on Cirrus, since the CI environment
# variable is set. When on a CI bot, it creates a temporary keychain and
# switches "match" to readonly mode to not create new profiles/certs on CI.
setup_travis
# Relative to this file.
raw_version = File.read('../../../../version')
puts "Building and deploying version #{raw_version}..."
update_app_identifier(
plist_path: 'Runner/Info.plist',
# Let the checked-in bundle ID be different so users don't collide on
# provisioning profile creation when building locally.
app_identifier: 'io.flutter.demo.gallery'
)
increment_version_number(
# Only major, minor, patch digits and dots.
version_number: /\d+\.\d+\.\d+/.match(raw_version)[0]
)
puts 'Retrieving signing certificates and profiles...'
# Stop fastlane from echoing back PUBLISHING_MATCH_CERTIFICATE_REPO var.
suppress_output {
# Retrieves all the necessary certs and provisioning profiles.
sync_code_signing(
git_url: ENV['PUBLISHING_MATCH_CERTIFICATE_REPO'],
type: 'appstore',
readonly: true
)
}
puts 'Certificates and profiles installed'
# Modify the Xcode project to use the new team and profile.
# It will put the git state to dirty but Travis will be wiped after
# then run session.
disable_automatic_code_signing
update_project_provisioning(
xcodeproj: 'Runner.xcodeproj',
target_filter: 'Runner',
build_configuration: 'Release',
profile: ENV['sigh_io.flutter.demo.gallery_appstore_profile-path'],
)
# Build and archive the app again.
build_ios_app(
workspace: 'Runner.xcworkspace',
scheme: 'Runner',
export_method: 'app-store',
# Verify that the right signing identity is used for publishing.
codesigning_identity: 'iPhone Distribution: Store Ladd (S8QB4VV633)',
)
if options[:upload]
upload_to_testflight
end
end
end