Class: Fastlane::Actions::HexsignProfilesDownloadAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



21
22
23
# File 'lib/fastlane/plugin/hexsign/actions/hexsign_profiles_download.rb', line 21

def self.authors
  ["HexSign"]
end

.available_optionsObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/fastlane/plugin/hexsign/actions/hexsign_profiles_download.rb', line 35

def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :id,
      env_name: "HEXSIGN_PROFILE_ID",
      description: "Provisioning profile ID to download",
      optional: false,
      type: String
    ),
    FastlaneCore::ConfigItem.new(
      key: :output_dir,
      env_name: "HEXSIGN_PROFILE_OUTPUT_DIR",
      description: "Directory to write the .mobileprovision file into",
      optional: true,
      type: String
    ),
    FastlaneCore::ConfigItem.new(
      key: :filename,
      env_name: "HEXSIGN_PROFILE_FILENAME",
      description: "Filename (no extension) for the downloaded profile",
      optional: true,
      type: String
    )
  ]
end

.categoryObject



71
72
73
# File 'lib/fastlane/plugin/hexsign/actions/hexsign_profiles_download.rb', line 71

def self.category
  :code_signing
end

.descriptionObject



17
18
19
# File 'lib/fastlane/plugin/hexsign/actions/hexsign_profiles_download.rb', line 17

def self.description
  "Download an Apple provisioning profile (.mobileprovision) via the HexSign CLI."
end

.detailsObject



25
26
27
28
29
30
31
32
33
# File 'lib/fastlane/plugin/hexsign/actions/hexsign_profiles_download.rb', line 25

def self.details
  <<~DETAILS
    Wraps `hexsign profiles download <id>`. The hexsign binary must be on PATH —
    install it with `brew install hexsign` or via the hexsign/hexsign-cli GitHub Action.

    Set HEXSIGN_CLIENT_ID and HEXSIGN_CLIENT_SECRET in the environment so the CLI runs
    in machine mode. See https://github.com/hexsign/hexsign-cli for token provisioning.
  DETAILS
end

.example_codeObject



65
66
67
68
69
# File 'lib/fastlane/plugin/hexsign/actions/hexsign_profiles_download.rb', line 65

def self.example_code
  [
    'hexsign_profiles_download(id: "prof-xyz789", output_dir: "build/sign")'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/fastlane/plugin/hexsign/actions/hexsign_profiles_download.rb', line 61

def self.is_supported?(platform)
  %i[ios mac tvos watchos visionos].include?(platform)
end

.run(params) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/fastlane/plugin/hexsign/actions/hexsign_profiles_download.rb', line 9

def self.run(params)
  args = ["profiles", "download", params[:id]]
  args.push("--output-dir", params[:output_dir]) if params[:output_dir]
  args.push("--filename", params[:filename]) if params[:filename]

  Helper::HexsignHelper.run(args).tap { UI.success("Downloaded provisioning profile #{params[:id]}") }
end