# 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(:ios)

platform :ios do
  
  desc "Push a new internal build to TestFlight"
  lane :internal do
    sync_code_signing
    sh "flutter build ios --release --no-codesign"
    build_app(
      skip_build_archive: true,
      archive_path: "../build/ios/archive/Runner.xcarchive",
    )
    upload_to_testflight(skip_waiting_for_build_processing: true)
  end

  desc "Push a new internal build to TestFlight"
  lane :beta do
    sync_code_signing
    sh "flutter build ios --release --no-codesign"
    build_app(
      skip_build_archive: true,
      archive_path: "../build/ios/archive/Runner.xcarchive",
    )
    upload_to_testflight(skip_waiting_for_build_processing: true)
  end

  desc "Push a new internal build to TestFlight"
  lane :production do
    sync_code_signing
    sh "flutter build ios --release --no-codesign"
    build_app(
      skip_build_archive: true,
      archive_path: "../build/ios/archive/Runner.xcarchive",
    )
    upload_to_app_store
  end

end
