Class: Fastlane::Actions::CertAction

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

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, lane_context, method_missing, other_action, output, return_value, sample_return_value, sh, step_text

Class Method Details

.authorObject



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

def self.author
  "KrauseFx"
end

.available_optionsObject



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

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

.categoryObject



67
68
69
# File 'lib/fastlane/actions/cert.rb', line 67

def self.category
  :code_signing
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

.detailsObject



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

def self.details
  [
    "**Important**: It is recommended to use [match](https://github.com/fastlane/fastlane/tree/master/match) according to the [codesigning.guide](https://codesigning.guide) for generating and maintaining your certificates. Use _cert_ directly only if you want full control over what's going on and know more about codesigning.",
    "Use this action to download the latest code signing identity"
  ].join("\n")
end

.example_codeObject



57
58
59
60
61
62
63
64
65
# File 'lib/fastlane/actions/cert.rb', line 57

def self.example_code
  [
    'cert',
    'cert(
      development: true,
      username: "[email protected]"
    )'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


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

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