# https://docs.fastlane.tools/actions/
# Change the syntax highlighting to Ruby

default_platform(:ios)

platform :ios do
  before_all do
    cocoapods
  end

  desc "Submit a new Beta Build to Apple TestFlight"
  desc "This will also make sure the profile is up to date"
  lane :beta do
    match(type: 'appstore', readonly: true)
    increment_build_number(xcodeproj: "Dusken.xcodeproj")
    build_app(scheme: "Dusken")
    upload_to_testflight(skip_waiting_for_build_processing: true)
    slack(message: "Chateau Neuf app build uploaded to TestFlight")
  end

  desc "Deploy a new version to the App Store"
  lane :release do
    match(type: 'appstore', readonly: true)
    increment_build_number(xcodeproj: "Dusken.xcodeproj")
    build_app(scheme: "Dusken")
    upload_to_app_store(force: true)
    slack(message: "Chateau Neuf app build uploaded to App Store")
  end

  lane :build do
    build_app(scheme: "Dusken")
  end

end
