pilot/lib/pilot/build_manager.rb in fastlane-2.28.3 vs pilot/lib/pilot/build_manager.rb in fastlane-2.28.4

- old
+ new

@@ -44,15 +44,13 @@ start(options) if config[:apple_id].to_s.length == 0 and config[:app_identifier].to_s.length == 0 config[:app_identifier] = UI.input("App Identifier: ") end - unless config[:update_build_info_on_upload] - if should_update_build_information(options) - build.update_build_information!(whats_new: options[:changelog], description: options[:beta_app_description], feedback_email: options[:beta_app_feedback_email]) - UI.success "Successfully set the changelog and/or description for build" - end + if should_update_build_information(options) + build.update_build_information!(whats_new: options[:changelog], description: options[:beta_app_description], feedback_email: options[:beta_app_feedback_email]) + UI.success "Successfully set the changelog and/or description for build" end return if config[:skip_submission] distribute_build(build, options) type = options[:distribute_external] ? 'External' : 'Internal' @@ -108,28 +106,32 @@ def distribute_build(uploaded_build, options) UI.message("Distributing new build to testers: #{uploaded_build.train_version} - #{uploaded_build.build_version}") # This is where we could add a check to see if encryption is required and has been updated uploaded_build.export_compliance.encryption_updated = false - uploaded_build.beta_review_info.demo_account_required = false - uploaded_build.submit_for_testflight_review! if options[:distribute_external] + uploaded_build.beta_review_info.demo_account_required = false + uploaded_build.submit_for_testflight_review! external_group = Spaceship::TestFlight::Group.default_external_group(app_id: uploaded_build.app_id) uploaded_build.add_group!(external_group) unless external_group.nil? if external_group.nil? && options[:groups].nil? UI.user_error!("You must specify at least one group using the `:groups` option to distribute externally") end - end - - if options[:groups] - groups = Group.filter_groups(app_id: uploaded_build.app_id) do |group| - options[:groups].include?(group.name) + if options[:groups] + groups = Spaceship::TestFlight::Group.filter_groups(app_id: uploaded_build.app_id) do |group| + options[:groups].include?(group.name) + end + groups.each do |group| + uploaded_build.add_group!(group) + end end - groups.each do |group| - uploaded_build.add_group!(group) + else # distribute internally + # in case any changes to export_compliance are required + if uploaded_build.export_compliance_missing? + uploaded_build.save! end end true end