Class: Fastlane::Actions::InstallCertificateAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/fastci/actions/install_certificate_action.rb

Overview

安装 p12 证书

Class Method Summary collapse

Class Method Details

.available_optionsObject



26
27
28
# File 'lib/fastlane/plugin/fastci/actions/install_certificate_action.rb', line 26

def self.available_options
  []
end

.categoryObject



34
35
36
# File 'lib/fastlane/plugin/fastci/actions/install_certificate_action.rb', line 34

def self.category
  :code_signing
end

.descriptionObject



22
23
24
# File 'lib/fastlane/plugin/fastci/actions/install_certificate_action.rb', line 22

def self.description
  "安装 p12 证书"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/fastlane/plugin/fastci/actions/install_certificate_action.rb', line 30

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

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fastlane/plugin/fastci/actions/install_certificate_action.rb', line 8

def self.run(params)
  UI.message("*************| 开始安装 p12 证书 |*************")

  certificate_paths = Dir.glob(File.expand_path("#{Environment.package_file_folder_name}/*.p12"))
  certificate_paths.each do |path|
    other_action.import_certificate(
      certificate_path: path,
      certificate_password: "#{Environment.certificate_password}",
      keychain_name: "login.keychain",
      keychain_password: "#{Environment.keychain_password}"
    )
  end
end