Class: Fastlane::Actions::PodPushAction

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

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, method_missing, other_action, sh, step_text

Class Method Details

.authorsObject



83
84
85
# File 'lib/fastlane/actions/pod_push.rb', line 83

def self.authors
  ["squarefrog"]
end

.available_optionsObject



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
# File 'lib/fastlane/actions/pod_push.rb', line 46

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :path,
                                 description: "The Podspec you want to push",
                                 optional: true,
                                 verify_block: proc do |value|
                                   UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
                                   UI.user_error!("File must be a `.podspec`") unless value.end_with?(".podspec")
                                 end),
    FastlaneCore::ConfigItem.new(key: :repo,
                                 description: "The repo you want to push. Pushes to Trunk by default",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :allow_warnings,
                                 description: "Allow warnings during pod push",
                                 optional: true,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :use_libraries,
                                 description: "Allow lint to use static libraries to install the spec",
                                 optional: true,
                                 is_string: false),
    FastlaneCore::ConfigItem.new(key: :sources,
                                 description: "The sources of repos you want the pod spec to lint with, separated by commas",
                                 optional: true,
                                 is_string: false,
                                 verify_block: proc do |value|
                                   UI.user_error!("Sources must be an array.") unless value.kind_of?(Array)
                                 end)
  ]
end

.descriptionObject



38
39
40
# File 'lib/fastlane/actions/pod_push.rb', line 38

def self.description
  "Push a Podspec to Trunk or a private repository"
end

.detailsObject



42
43
44
# File 'lib/fastlane/actions/pod_push.rb', line 42

def self.details
  ""
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


87
88
89
# File 'lib/fastlane/actions/pod_push.rb', line 87

def self.is_supported?(platform)
  true
end

.outputObject



76
77
# File 'lib/fastlane/actions/pod_push.rb', line 76

def self.output
end

.return_valueObject



79
80
81
# File 'lib/fastlane/actions/pod_push.rb', line 79

def self.return_value
  nil
end

.run(params) ⇒ Object



4
5
6
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
# File 'lib/fastlane/actions/pod_push.rb', line 4

def self.run(params)
  if params[:repo]
    repo = params[:repo]
    command = "pod repo push #{repo}"
  else
    command = 'pod trunk push'
  end

  if params[:path]
    command << " '#{params[:path]}'"
  end

  if params[:sources]
    sources = params[:sources].join(",")
    command << " --sources='#{sources}'"
  end

  if params[:allow_warnings]
    command << " --allow-warnings"
  end

  if params[:use_libraries]
    command << " --use-libraries"
  end

  result = Actions.sh(command.to_s)
  UI.success("Successfully pushed Podspec ⬆️ ")
  return result
end