-
Notifications
You must be signed in to change notification settings - Fork 8
/
rekor-cli.rb
44 lines (37 loc) · 1.35 KB
/
rekor-cli.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# typed: false
# frozen_string_literal: true
class RekorCli < Formula
desc "Secure Supply Chain - Transparency Log"
homepage "https://sigstore.dev"
version "1.3.4"
license "Apache-2.0"
head "https://github.com/sigstore/rekor.git", tag: "v1.3.4"
on_macos do
if Hardware::CPU.intel?
url "https://github.com/sigstore/rekor/releases/download/v#{version}/rekor-cli-darwin-amd64"
sha256 "784d675fc623765811842209184b87bdbbe25d21cf68ab53568f2055938d2ffb"
end
if Hardware::CPU.arm?
url "https://github.com/sigstore/rekor/releases/download/v#{version}/rekor-cli-darwin-arm64"
sha256 "2c5f6209bf6ad4e5aa02289a6034a0d41760a6f396925eb11ff39b80fe6f7f22"
end
end
on_linux do
if Hardware::CPU.intel?
url "https://github.com/sigstore/rekor/releases/download/v#{version}/rekor-cli-linux-amd64"
sha256 "2595b1499c9849fa841460004bd529537081961b4983758535b4311c641afdca"
end
if Hardware::CPU.arm?
url "https://github.com/sigstore/rekor/releases/download/v#{version}/rekor-cli-linux-arm64"
sha256 "066a922a5677660eee6fc6b8d53a703d8d58224ccb42c329628e2b4b8c9a1a54"
end
end
def install
cpu = Hardware::CPU.intel? ? "amd64" : "arm64"
os = OS.mac? ? "darwin" : "linux"
bin.install "rekor-cli-#{os}-#{cpu}" => "rekor-cli"
end
test do
system "#{bin}/rekor-cli", "version"
end
end