fastlane-plugin-hexsign 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 67ae47604a746cc168dd35f48cc3f58d8eb9d70f9c28613004673ecf22b0491d
4
+ data.tar.gz: f20b85fc29619f3a33bed881b02d49f25bd1db91d9f697776910ef37ea8e60a1
5
+ SHA512:
6
+ metadata.gz: 56c2e8435a98b6e2e25291eb317bc8eaa4c61cc983264072056d230c8cbad5eba3a17f9d6d089ead9354620da8e2dfba53d80d2b7f6af04a5242873d60c11cde
7
+ data.tar.gz: a32eae25d357b1676bcb5b15821e77c3609f5842dd0043d90ad9bc7e9edbe0c7cbdf189257c0366f5a1da381b6bc55d527e9cd36946d9c688498cb1a505f336d
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HexSign
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,115 @@
1
+ <p align="center">
2
+ <a href="https://hexsign.io">
3
+ <img src="https://hexsign.io/logo.png" alt="HexSign" height="64" />
4
+ </a>
5
+ </p>
6
+
7
+ <h1 align="center">fastlane-plugin-hexsign</h1>
8
+
9
+ <p align="center">
10
+ Fastlane actions for <a href="https://hexsign.io">HexSign</a> — fetch Apple signing material in your lanes.
11
+ </p>
12
+
13
+ ---
14
+
15
+ ## Install
16
+
17
+ Add to your project's `Pluginfile`:
18
+
19
+ ```ruby
20
+ gem "fastlane-plugin-hexsign"
21
+ ```
22
+
23
+ Then:
24
+
25
+ ```sh
26
+ bundle install
27
+ ```
28
+
29
+ The plugin shells out to the `hexsign` CLI. You must install it separately:
30
+
31
+ ```sh
32
+ brew install hexsign
33
+ ```
34
+
35
+ …or use the [hexsign/hexsign-cli](https://github.com/hexsign/hexsign-cli) GitHub Action in CI.
36
+
37
+ ## Authentication
38
+
39
+ The CLI auto-detects machine mode when these env vars are set:
40
+
41
+ ```sh
42
+ HEXSIGN_CLIENT_ID=…
43
+ HEXSIGN_CLIENT_SECRET=…
44
+ ```
45
+
46
+ Provision a service credential in the [HexSign dashboard](https://dashboard.hexsign.net) under **Settings → CLI Tokens**.
47
+
48
+ ## Actions
49
+
50
+ ### `hexsign_certificates_download`
51
+
52
+ Downloads a signing certificate (`.p12` + `.password`).
53
+
54
+ ```ruby
55
+ hexsign_certificates_download(
56
+ id: ENV["HEXSIGN_CERT_ID"],
57
+ output_dir: "build/sign"
58
+ )
59
+ ```
60
+
61
+ | Option | Env | Required | Description |
62
+ |---|---|---|---|
63
+ | `id` | `HEXSIGN_CERTIFICATE_ID` | yes | Certificate ID |
64
+ | `output_dir` | `HEXSIGN_CERTIFICATE_OUTPUT_DIR` | no | Output directory |
65
+ | `filename` | `HEXSIGN_CERTIFICATE_FILENAME` | no | Base filename (no extension) |
66
+
67
+ ### `hexsign_profiles_download`
68
+
69
+ Downloads a provisioning profile (`.mobileprovision`).
70
+
71
+ ```ruby
72
+ hexsign_profiles_download(
73
+ id: ENV["HEXSIGN_PROFILE_ID"],
74
+ output_dir: "build/sign"
75
+ )
76
+ ```
77
+
78
+ | Option | Env | Required | Description |
79
+ |---|---|---|---|
80
+ | `id` | `HEXSIGN_PROFILE_ID` | yes | Provisioning profile ID |
81
+ | `output_dir` | `HEXSIGN_PROFILE_OUTPUT_DIR` | no | Output directory |
82
+ | `filename` | `HEXSIGN_PROFILE_FILENAME` | no | Filename (no extension) |
83
+
84
+ ## Example lane
85
+
86
+ ```ruby
87
+ lane :beta do
88
+ hexsign_certificates_download(id: ENV["HEXSIGN_CERT_ID"], output_dir: "build/sign")
89
+ hexsign_profiles_download (id: ENV["HEXSIGN_PROFILE_ID"], output_dir: "build/sign")
90
+
91
+ import_certificate(
92
+ certificate_path: "build/sign/certificate.p12",
93
+ certificate_password: File.read("build/sign/certificate.password").strip,
94
+ keychain_name: "build.keychain"
95
+ )
96
+
97
+ gym(scheme: "MyApp")
98
+ end
99
+ ```
100
+
101
+ ## Development
102
+
103
+ ```sh
104
+ bundle install
105
+ bundle exec rake # runs rspec + rubocop
106
+ ```
107
+
108
+ ## Contributing & security
109
+
110
+ - Bugs / feature requests: open a GitHub issue.
111
+ - Security vulnerabilities: email **support@hexsign.io** — please do **not** open a public issue.
112
+
113
+ ## License
114
+
115
+ [MIT](LICENSE).
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "fastlane/action"
4
+ require_relative "../helper/hexsign_helper"
5
+
6
+ module Fastlane
7
+ module Actions
8
+ class HexsignCertificatesDownloadAction < Action
9
+ def self.run(params)
10
+ args = ["certificates", "download", params[:id]]
11
+ args.push("--output-dir", params[:output_dir]) if params[:output_dir]
12
+ args.push("--filename", params[:filename]) if params[:filename]
13
+
14
+ Helper::HexsignHelper.run(args).tap { UI.success("Downloaded certificate #{params[:id]}") }
15
+ end
16
+
17
+ def self.description
18
+ "Download an Apple signing certificate (.p12 + .password) via the HexSign CLI."
19
+ end
20
+
21
+ def self.authors
22
+ ["HexSign"]
23
+ end
24
+
25
+ def self.details
26
+ <<~DETAILS
27
+ Wraps `hexsign certificates download <id>`. The hexsign binary must be on PATH —
28
+ install it with `brew install hexsign` or via the hexsign/hexsign-cli GitHub Action.
29
+
30
+ Set HEXSIGN_CLIENT_ID and HEXSIGN_CLIENT_SECRET in the environment so the CLI runs
31
+ in machine mode. See https://github.com/hexsign/hexsign-cli for token provisioning.
32
+ DETAILS
33
+ end
34
+
35
+ def self.available_options
36
+ [
37
+ FastlaneCore::ConfigItem.new(
38
+ key: :id,
39
+ env_name: "HEXSIGN_CERTIFICATE_ID",
40
+ description: "Certificate ID to download",
41
+ optional: false,
42
+ type: String
43
+ ),
44
+ FastlaneCore::ConfigItem.new(
45
+ key: :output_dir,
46
+ env_name: "HEXSIGN_CERTIFICATE_OUTPUT_DIR",
47
+ description: "Directory to write the .p12 and .password files into",
48
+ optional: true,
49
+ type: String
50
+ ),
51
+ FastlaneCore::ConfigItem.new(
52
+ key: :filename,
53
+ env_name: "HEXSIGN_CERTIFICATE_FILENAME",
54
+ description: "Base filename (no extension) for the downloaded files",
55
+ optional: true,
56
+ type: String
57
+ )
58
+ ]
59
+ end
60
+
61
+ def self.is_supported?(platform)
62
+ %i[ios mac tvos watchos visionos].include?(platform)
63
+ end
64
+
65
+ def self.example_code
66
+ [
67
+ 'hexsign_certificates_download(id: "cert-abc123", output_dir: "build/sign")'
68
+ ]
69
+ end
70
+
71
+ def self.category
72
+ :code_signing
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "fastlane/action"
4
+ require_relative "../helper/hexsign_helper"
5
+
6
+ module Fastlane
7
+ module Actions
8
+ class HexsignProfilesDownloadAction < Action
9
+ def self.run(params)
10
+ args = ["profiles", "download", params[:id]]
11
+ args.push("--output-dir", params[:output_dir]) if params[:output_dir]
12
+ args.push("--filename", params[:filename]) if params[:filename]
13
+
14
+ Helper::HexsignHelper.run(args).tap { UI.success("Downloaded provisioning profile #{params[:id]}") }
15
+ end
16
+
17
+ def self.description
18
+ "Download an Apple provisioning profile (.mobileprovision) via the HexSign CLI."
19
+ end
20
+
21
+ def self.authors
22
+ ["HexSign"]
23
+ end
24
+
25
+ def self.details
26
+ <<~DETAILS
27
+ Wraps `hexsign profiles download <id>`. The hexsign binary must be on PATH —
28
+ install it with `brew install hexsign` or via the hexsign/hexsign-cli GitHub Action.
29
+
30
+ Set HEXSIGN_CLIENT_ID and HEXSIGN_CLIENT_SECRET in the environment so the CLI runs
31
+ in machine mode. See https://github.com/hexsign/hexsign-cli for token provisioning.
32
+ DETAILS
33
+ end
34
+
35
+ def self.available_options
36
+ [
37
+ FastlaneCore::ConfigItem.new(
38
+ key: :id,
39
+ env_name: "HEXSIGN_PROFILE_ID",
40
+ description: "Provisioning profile ID to download",
41
+ optional: false,
42
+ type: String
43
+ ),
44
+ FastlaneCore::ConfigItem.new(
45
+ key: :output_dir,
46
+ env_name: "HEXSIGN_PROFILE_OUTPUT_DIR",
47
+ description: "Directory to write the .mobileprovision file into",
48
+ optional: true,
49
+ type: String
50
+ ),
51
+ FastlaneCore::ConfigItem.new(
52
+ key: :filename,
53
+ env_name: "HEXSIGN_PROFILE_FILENAME",
54
+ description: "Filename (no extension) for the downloaded profile",
55
+ optional: true,
56
+ type: String
57
+ )
58
+ ]
59
+ end
60
+
61
+ def self.is_supported?(platform)
62
+ %i[ios mac tvos watchos visionos].include?(platform)
63
+ end
64
+
65
+ def self.example_code
66
+ [
67
+ 'hexsign_profiles_download(id: "prof-xyz789", output_dir: "build/sign")'
68
+ ]
69
+ end
70
+
71
+ def self.category
72
+ :code_signing
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "fastlane_core/ui/ui"
4
+ require "open3"
5
+ require "shellwords"
6
+
7
+ module Fastlane
8
+ UI = FastlaneCore::UI unless Fastlane.const_defined?(:UI)
9
+
10
+ module Helper
11
+ class HexsignHelper
12
+ INSTALL_HINT = "Install it with `brew install hexsign` or via the hexsign/hexsign-cli GitHub Action."
13
+
14
+ def self.binary_path
15
+ @binary_path ||= find_binary
16
+ end
17
+
18
+ # Resets memoization. Tests only.
19
+ def self.reset!
20
+ @binary_path = nil
21
+ end
22
+
23
+ def self.find_binary
24
+ path = which("hexsign")
25
+ UI.user_error!("hexsign binary not found on PATH. #{INSTALL_HINT}") if path.nil?
26
+ path
27
+ end
28
+
29
+ def self.which(cmd)
30
+ exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
31
+ ENV["PATH"].to_s.split(File::PATH_SEPARATOR).each do |dir|
32
+ exts.each do |ext|
33
+ candidate = File.join(dir, "#{cmd}#{ext}")
34
+ return candidate if File.executable?(candidate) && !File.directory?(candidate)
35
+ end
36
+ end
37
+ nil
38
+ end
39
+
40
+ # Runs the CLI and returns stdout. Raises FastlaneCore::Interface::FastlaneError
41
+ # on non-zero exit, surfacing stderr to the user.
42
+ def self.run(args)
43
+ cmd = [binary_path, *args]
44
+ UI.command(cmd.shelljoin)
45
+ stdout, stderr, status = Open3.capture3(*cmd)
46
+ unless status.success?
47
+ UI.error(stderr.strip) unless stderr.strip.empty?
48
+ UI.user_error!("hexsign exited with status #{status.exitstatus}")
49
+ end
50
+ stdout
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fastlane
4
+ module Hexsign
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "fastlane/plugin/hexsign/version"
4
+
5
+ module Fastlane
6
+ module Hexsign
7
+ # Auto-load every action and helper in this gem so Fastlane can discover them.
8
+ def self.all_classes
9
+ Dir[File.expand_path("hexsign/**/*.rb", __dir__)]
10
+ end
11
+ end
12
+ end
13
+
14
+ Fastlane::Hexsign.all_classes.each { |f| require f }
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-hexsign
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - HexSign
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-05-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: fastlane
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.210.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.210.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '13.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '13.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.12'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.12'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.50'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.50'
69
+ description:
70
+ email: support@hexsign.io
71
+ executables: []
72
+ extensions: []
73
+ extra_rdoc_files: []
74
+ files:
75
+ - LICENSE
76
+ - README.md
77
+ - lib/fastlane/plugin/hexsign.rb
78
+ - lib/fastlane/plugin/hexsign/actions/hexsign_certificates_download.rb
79
+ - lib/fastlane/plugin/hexsign/actions/hexsign_profiles_download.rb
80
+ - lib/fastlane/plugin/hexsign/helper/hexsign_helper.rb
81
+ - lib/fastlane/plugin/hexsign/version.rb
82
+ homepage: https://github.com/hexsign/fastlane-plugin-hexsign
83
+ licenses:
84
+ - MIT
85
+ metadata:
86
+ homepage_uri: https://hexsign.io
87
+ source_code_uri: https://github.com/hexsign/fastlane-plugin-hexsign
88
+ bug_tracker_uri: https://github.com/hexsign/fastlane-plugin-hexsign/issues
89
+ rubygems_mfa_required: 'true'
90
+ post_install_message:
91
+ rdoc_options: []
92
+ require_paths:
93
+ - lib
94
+ required_ruby_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '3.0'
99
+ required_rubygems_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ requirements: []
105
+ rubygems_version: 3.5.22
106
+ signing_key:
107
+ specification_version: 4
108
+ summary: Fastlane actions for HexSign — fetch Apple signing material from your lanes.
109
+ test_files: []