# 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 # ## Update these lines to match your project! # Bundle Identifier used for the iOS App on the App Store Connect portal APP_IDENTIFIER = 'no.tjer.HelloWorld' # Issuer ID from the Keys section of https://appstoreconnect.apple.com/access/users APPSTORECONNECT_ISSUER_ID = '69a6de83-feb7-47e3-e053-5b8c7c11a4d1' # Key ID from the key matching the `APP_STORE_CONNECT_API_KEY_KEY` secret, found under the Keys section of https://appstoreconnect.apple.com/access/users APPSTORECONNECT_KEY_ID = 'YRQDJRKMR9' # Uncomment the line if you want fastlane to automatically update itself # update_fastlane default_platform(:ios) platform :ios do desc "Push a new beta build to TestFlight" lane :beta do |options| setup_ci if ENV['CI'] is_example_repo = ENV['CI'] && ENV['GITHUB_REPOSITORY'] == 'jorgenpt/flutter_github_example' if !is_example_repo && APP_IDENTIFIER == 'no.tjer.HelloWorld' then UI.user_error! "You need to update your Fastfile to use your own `APP_IDENTIFIER`" end # Download code signing certificates using `match` (and the `MATCH_PASSWORD` secret) sync_code_signing( type: "appstore", app_identifier: APP_IDENTIFIER, readonly: true ) if !is_example_repo then if APPSTORECONNECT_ISSUER_ID == '69a6de83-feb7-47e3-e053-5b8c7c11a4d1' then UI.user_error! "You need to update your Fastfile to use your own `APPSTORECONNECT_ISSUER_ID`" end if APPSTORECONNECT_KEY_ID == 'YRQDJRKMR9' then UI.user_error! "You need to update your Fastfile to use your own `APPSTORECONNECT_KEY_ID`" end end # We expose the key data using `APP_STORE_CONNECT_API_KEY_KEY` secret on GH app_store_connect_api_key( key_id: APPSTORECONNECT_KEY_ID, issuer_id: APPSTORECONNECT_ISSUER_ID ) # Figure out the build number (and optionally build name) new_build_number = (latest_testflight_build_number + 1) extra_config_args = [] if options.key?(:build_name) then extra_config_args = ["--build-name", options[:build_name].delete_prefix('v')] end # Prep the xcodeproject from Flutter without building (`--config-only`) sh( "flutter", "build", "ios", "--config-only", "--release", "--no-pub", "--no-codesign", "--build-number", new_build_number.to_s, *extra_config_args ) # Build & sign using Runner.xcworkspace build_app( workspace: "Runner.xcworkspace", scheme: "Runner", output_directory: "../build/ios/archive" ) upload_to_testflight( # This takes a long time, so don't waste GH runner minutes (but it means manually needing to # set the build live for external testers). skip_waiting_for_build_processing: true, ) end end