diff --git a/dev/bots/travis_script.sh b/dev/bots/travis_script.sh index 1b59b06ad9..88bc5385bb 100755 --- a/dev/bots/travis_script.sh +++ b/dev/bots/travis_script.sh @@ -22,9 +22,14 @@ if [ "$SHARD" = "build_and_deploy_gallery" ]; then echo "Building Flutter Gallery for iOS..." (cd examples/flutter_gallery; flutter build ios --release --no-codesign) echo "iOS Flutter Gallery built" - if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" == "dev" && $version != *"pre"* ]]; then - echo "Re-building with distribution profile and deploying to TestFlight..." - (cd examples/flutter_gallery/ios; bundle install && bundle exec fastlane build_and_deploy_testflight) + if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then + if [[ "$TRAVIS_BRANCH" == "dev" && $version != *"pre"* ]]; then + echo "Archiving with distribution profile and deploying to TestFlight..." + (cd examples/flutter_gallery/ios; bundle install && bundle exec fastlane build_and_deploy_testflight upload:true) + else + echo "Archiving with distribution profile..." + (cd examples/flutter_gallery/ios; bundle install && bundle exec fastlane build_and_deploy_testflight) + fi else echo "Flutter Gallery is only deployed to the TestFlight on merged and tagged dev branch commits" fi diff --git a/examples/flutter_gallery/ios/fastlane/Fastfile b/examples/flutter_gallery/ios/fastlane/Fastfile index 1e0195f728..f689b64ab2 100644 --- a/examples/flutter_gallery/ios/fastlane/Fastfile +++ b/examples/flutter_gallery/ios/fastlane/Fastfile @@ -19,7 +19,7 @@ end # rebuild the app by: # 1- Signing using the publishing credentials; and # 2- xcodebuild with archive option -platform :ios do +platform :ios do |options| desc 'Push a new release to TestFlight' lane :build_and_deploy_testflight do # Doesn't do anything when not on Travis. @@ -73,6 +73,8 @@ platform :ios do codesigning_identity: 'iPhone Distribution: Store Ladd (S8QB4VV633)', ) - upload_to_testflight + if options[:upload] + upload_to_testflight + end end end