Class: Fastlane::Actions::DeliverAction

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

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, details, output, sh

Class Method Details

.authorObject



77
78
79
# File 'lib/fastlane/actions/deliver.rb', line 77

def self.author
  "KrauseFx"
end

.available_optionsObject



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/fastlane/actions/deliver.rb', line 41

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :force,
                                 env_name: "FL_DELIVER_FORCE",
                                 description: "Set to true to skip PDF verification",
                                 optional: true,
                                 default_value: false,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :beta,
                                 env_name: "FL_DELIVER_BETA",
                                 description: "Upload a new version to TestFlight",
                                 optional: true,
                                 default_value: false,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :skip_deploy,
                                 env_name: "FL_DELIVER_SKIP_DEPLOY",
                                 description: "Skip the submission of the app - it will only be uploaded",
                                 optional: true,
                                 default_value: false,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :metadata_only,
                                 env_name: "DELIVER_SKIP_BINARY",
                                 description: "Skip the binary upload and upload app metadata only",
                                 optional: true,
                                 default_value: false,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :deliver_file_path,
                                 env_name: "FL_DELIVER_CONFIG_PATH",
                                 description: "Specify a path to the directory containing the Deliverfile",
                                 default_value: FastlaneFolder.path || Dir.pwd, # defaults to fastlane folder
                                 verify_block: Proc.new do |value|
                                  raise "Couldn't find folder '#{value}'. Make sure to pass the path to the directory not the file!".red unless File.directory?(value)
                                 end)
  ]
end

.descriptionObject



37
38
39
# File 'lib/fastlane/actions/deliver.rb', line 37

def self.description
  "Uses deliver to upload new app metadata and builds to iTunes Connect"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/fastlane/actions/deliver.rb', line 81

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
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/fastlane/actions/deliver.rb', line 7

def self.run(config)
  require 'deliver'

  FastlaneCore::UpdateChecker.start_looking_for_update('deliver') unless Helper.is_test?

  begin
    ENV['DELIVER_SCREENSHOTS_PATH'] = Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] # use snapshot's screenshots if there
    ENV['DELIVER_SKIP_BINARY'] = "1" if config[:metadata_only]

    Dir.chdir(config[:deliver_file_path] || FastlaneFolder.path || Dir.pwd) do
      # This should be executed in the fastlane folder
      return if Helper.is_test?

      Deliver::Deliverer.new(nil,
                             force: config[:force],
                             is_beta_ipa: config[:beta],
                             skip_deploy: config[:skip_deploy])

      if ENV['DELIVER_IPA_PATH'] # since IPA upload is optional
        Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = File.expand_path(ENV['DELIVER_IPA_PATH']) # deliver will store it in the environment
      end

      # The user might used a different account for deliver
      CredentialsManager::PasswordManager.logout
    end
  ensure
    FastlaneCore::UpdateChecker.show_update_status('deliver', Deliver::VERSION)
  end
end