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, sh, step_text

Class Method Details

.authorsObject



55
56
57
# File 'lib/fastlane/actions/pod_push.rb', line 55

def self.authors
  ["squarefrog"]
end

.available_optionsObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fastlane/actions/pod_push.rb', line 33

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :path,
                                 description: "The Podspec you want to push",
                                 optional: true,
                                 verify_block: proc do |value|
                                   raise "Couldn't find file at path '#{value}'".red unless File.exist?(value)
                                   raise "File must be a `.podspec`".red 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)
  ]
end

.descriptionObject



25
26
27
# File 'lib/fastlane/actions/pod_push.rb', line 25

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

.detailsObject



29
30
31
# File 'lib/fastlane/actions/pod_push.rb', line 29

def self.details
  ""
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/fastlane/actions/pod_push.rb', line 59

def self.is_supported?(platform)
  true
end

.outputObject



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

def self.output
end

.return_valueObject



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

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
# 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

  result = Actions.sh("#{command}")
  Helper.log.info "Successfully pushed Podspec ⬆️ ".green
  return result
end