fastlane_version "2.225.0" default_platform(:ios) groups = ["Kepelet"] configuration = "Release" platform :ios do desc "load App Store Connect API key" lane :load_asc_api_key do app_store_connect_api_key( key_id: ENV["ASC_KEY_ID"], issuer_id: ENV["ASC_ISSUER_ID"], key_content: ENV["ASC_KEY_CONTENT"], is_key_content_base64: false, in_house: false ) end desc "sync certs thing" lane :sync_certs do api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] match({readonly: true, type: "appstore", api_key: api_key}) end desc "bump build number based on latest TestFlight build number" lane :fetch_and_increment_build_number do app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] latest_build_number = latest_testflight_build_number( api_key: api_key, version: get_version_number, app_identifier: app_identifier ) increment_build_number(build_number: (latest_build_number + 1)) end desc "build app" lane :build do load_asc_api_key sync_certs fetch_and_increment_build_number build_app(configuration: configuration) end desc "push a new build to TestFlight" lane :beta do |options| is_public = options[:public] || false setup_ci if ENV['CI'] app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] build upload_to_testflight( changelog: "Build #{get_build_number}", api_key: api_key, app_identifier: app_identifier, distribute_external: is_public, groups: groups, ) end end