Class: Fastlane::Actions::GetCertificatesAction

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

Direct Known Subclasses

CertAction

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, deprecated_notes, lane_context, method_missing, other_action, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorObject



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

def self.author
  "KrauseFx"
end

.available_optionsObject



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

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

.categoryObject



72
73
74
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 72

def self.category
  :code_signing
end

.descriptionObject



30
31
32
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 30

def self.description
  "Create new iOS code signing certificates (via _cert_)"
end

.detailsObject



34
35
36
37
38
39
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 34

def self.details
  [
    "**Important**: It is recommended to use [match](https://docs.fastlane.tools/actions/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



61
62
63
64
65
66
67
68
69
70
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 61

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

.is_supported?(platform) ⇒ Boolean

Returns:



57
58
59
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 57

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

.outputObject



46
47
48
49
50
51
# File 'fastlane/lib/fastlane/actions/get_certificates.rb', line 46

def self.output
  [
    ['CERT_FILE_PATH', 'The path to the certificate'],
    ['CERT_CERTIFICATE_ID', 'The id of the certificate']
  ]
end

.run(params) ⇒ Object



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

def self.run(params)
  require 'cert'

  return if Helper.test?

  begin
    Cert.config = params # we alread have the finished config
    Cert.config[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]

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