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

Class Method Details

.authorObject



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

def self.author
  "KrauseFx"
end

.available_optionsObject



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

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

.descriptionObject



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

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

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/fastlane/actions/cert.rb', line 52

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
32
33
34
35
36
# File 'lib/fastlane/actions/cert.rb', line 9

def self.run(params)
  require 'cert'
  require 'cert/options'

  return if Helper.test?

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

  begin
    Dir.chdir(FastlaneFolder.path || Dir.pwd) do
      # This should be executed in the fastlane folder

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

      Cert::CertRunner.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

      Helper.log.info("Use signing certificate '#{certificate_id}' from now on!".green)

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