Class: Fastlane::Actions::UpdateUwpSigningSettingsAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



30
31
32
# File 'lib/fastlane/plugin/sapfire/actions/update_uwp_signing_settings_action.rb', line 30

def self.authors
  ["CheeryLee"]
end

.available_optionsObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/fastlane/plugin/sapfire/actions/update_uwp_signing_settings_action.rb', line 45

def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :certificate,
      env_name: "SF_UWP_CERTIFICATE_PATH",
      description: "Path to the certificate to use",
      optional: false,
      type: String,
      verify_block: proc do |value|
        UI.user_error!("Path to certificate is invalid") unless value && !value.empty?
        UI.user_error!("The provided path doesn't point to PFX-file") unless
          File.exist?(File.expand_path(value)) && value.end_with?(".pfx")
      end
    ),
    FastlaneCore::ConfigItem.new(
      key: :password,
      env_name: "SF_UWP_CERTIFICATE_PASSWORD",
      description: "The password for the private key in the certificate",
      optional: true,
      default_value: "",
      type: String
    ),
    FastlaneCore::ConfigItem.new(
      key: :thumbprint,
      description: "This value must match the thumbprint in the signing certificate or be an empty string",
      optional: true,
      default_value: "",
      type: String
    )
  ]
end

.categoryObject



77
78
79
# File 'lib/fastlane/plugin/sapfire/actions/update_uwp_signing_settings_action.rb', line 77

def self.category
  :code_signing
end

.descriptionObject



22
23
24
# File 'lib/fastlane/plugin/sapfire/actions/update_uwp_signing_settings_action.rb', line 22

def self.description
  "Configures UWP package signing settings. Works only on 'windows' platform. Values that would be set in this action will be applied to all next actions."
end

.detailsObject



26
27
28
# File 'lib/fastlane/plugin/sapfire/actions/update_uwp_signing_settings_action.rb', line 26

def self.details
  "Works only on `windows` platform"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/fastlane/plugin/sapfire/actions/update_uwp_signing_settings_action.rb', line 34

def self.is_supported?(platform)
  [:windows].include?(platform)
end

.outputObject



38
39
40
41
42
43
# File 'lib/fastlane/plugin/sapfire/actions/update_uwp_signing_settings_action.rb', line 38

def self.output
  [
    ["SF_UWP_CERTIFICATE_PATH", "Path to the certificate to use"],
    ["SF_UWP_CERTIFICATE_PASSWORD", "The password for the private key in the certificate"]
  ]
end

.run(params) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/fastlane/plugin/sapfire/actions/update_uwp_signing_settings_action.rb', line 12

def self.run(params)
  path = params[:certificate]

  Actions.lane_context[SharedValues::SF_CERTIFICATE_PATH] = path
  Actions.lane_context[SharedValues::SF_CERTIFICATE_PASSWORD] = params[:password]
  Actions.lane_context[SharedValues::SF_CERTIFICATE_THUMBPRINT] = params[:thumbprint]

  UI.message("Setting signing certificate to '#{path}' for all next build steps")
end