Class: Fastlane::Actions::UploadToAppStoreAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/upload_to_app_store.rb

Direct Known Subclasses

AppstoreAction, DeliverAction

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, deprecated_notes, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorObject



47
48
49
# File 'fastlane/lib/fastlane/actions/upload_to_app_store.rb', line 47

def self.author
  "KrauseFx"
end

.available_optionsObject



41
42
43
44
45
# File 'fastlane/lib/fastlane/actions/upload_to_app_store.rb', line 41

def self.available_options
  require "deliver"
  require "deliver/options"
  FastlaneCore::CommanderGenerator.new.generate(Deliver::Options.available_options)
end

.categoryObject



66
67
68
# File 'fastlane/lib/fastlane/actions/upload_to_app_store.rb', line 66

def self.category
  :production
end

.descriptionObject



26
27
28
# File 'fastlane/lib/fastlane/actions/upload_to_app_store.rb', line 26

def self.description
  "Upload metadata and binary to App Store Connect (via _deliver_)"
end

.detailsObject



30
31
32
33
34
35
36
37
38
39
# File 'fastlane/lib/fastlane/actions/upload_to_app_store.rb', line 30

def self.details
  [
    "Using _upload_to_app_store_ after _build_app_ and _capture_screenshots_ will automatically upload the latest ipa and screenshots with no other configuration.",
    "",
    "If you don't want to verify an HTML preview for App Store builds, use the `:force` option.",
    "This is useful when running _fastlane_ on your Continuous Integration server:",
    "`_upload_to_app_store_(force: true)`",
    "If your account is on multiple teams and you need to tell the `iTMSTransporter` which 'provider' to use, you can set the `:itc_provider` option to pass this info."
  ].join("\n")
end

.example_codeObject



55
56
57
58
59
60
61
62
63
64
# File 'fastlane/lib/fastlane/actions/upload_to_app_store.rb', line 55

def self.example_code
  [
    'upload_to_app_store(
      force: true, # Set to true to skip verification of HTML preview
      itc_provider: "abcde12345" # pass a specific value to the iTMSTransporter -itc_provider option
    )',
    'deliver   # alias for "upload_to_app_store"',
    'appstore  # alias for "upload_to_app_store"'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



51
52
53
# File 'fastlane/lib/fastlane/actions/upload_to_app_store.rb', line 51

def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
end

.run(config) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'fastlane/lib/fastlane/actions/upload_to_app_store.rb', line 7

def self.run(config)
  require 'deliver'

  begin
    config.load_configuration_file("Deliverfile")
    config[:screenshots_path] ||= Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] if Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH]
    config[:ipa] ||= Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] if Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]
    config[:pkg] ||= Actions.lane_context[SharedValues::PKG_OUTPUT_PATH] if Actions.lane_context[SharedValues::PKG_OUTPUT_PATH]

    # Only set :api_key from SharedValues if :api_key_path isn't set (conflicting options)
    unless config[:api_key_path]
      config[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
    end

    return config if Helper.test?
    Deliver::Runner.new(config).run
  end
end