Class: Fastlane::Actions::CertAction

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

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, details, output, return_value, sh, step_text

Class Method Details

.authorObject



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

def self.author
  "KrauseFx"
end

.available_optionsObject



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

def self.available_options
  require 'cert'
  Cert::Options.available_options
end

.descriptionObject



33
34
35
# File 'lib/fastlane/actions/cert.rb', line 33

def self.description
  "Fetch or generate the latest available code signing identity"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/fastlane/actions/cert.rb', line 46

def self.is_supported?(platform)
  platform == :ios
end

.run(params) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/fastlane/actions/cert.rb', line 9

def self.run(params)
  require 'cert'

  return if Helper.test?

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

  begin
    Cert.config = params # we alread have the finished config

    Cert::Runner.new.launch
    cert_file_path = ENV["CER_FILE_PATH"]
    certificate_id = ENV["CER_CERTIFICATE_ID"]
    Actions.lane_context[SharedValues::CERT_FILE_PATH] = cert_file_path
    Actions.lane_context[SharedValues::CERT_CERTIFICATE_ID] = certificate_id

    UI.success("Use signing certificate '#{certificate_id}' from now on!")

    ENV["SIGH_CERTIFICATE_ID"] = certificate_id # for further use in the sigh action
  ensure
    FastlaneCore::UpdateChecker.show_update_status('cert', Cert::VERSION)
  end
end