Skip to content

Commit

Permalink
redo formula
Browse files Browse the repository at this point in the history
  • Loading branch information
zosocanuck committed Mar 30, 2023
1 parent 877dad1 commit adf8f26
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
pr-pull:
if: contains(github.event.pull_request.labels.*.name, 'pr-pull')
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ jobs:
test-bot:
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
token: ${{ secrets.GH_TOKEN }}

- name: Cache Homebrew Bundler RubyGems
id: cache
Expand Down
39 changes: 29 additions & 10 deletions Formula/sigscan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,41 @@ class Sigscan < Formula
desc "Inspect container images and other artifacts for signatures"
homepage "https://github.com/venafi/sigscan"
url "https://github.com/venafi/sigscan/archive/refs/tags/v0.1.0.tar.gz"
sha256 "626e2b78b327cffd3d43407c981e0ba961fc21d2f7dfb1d202a9eb175dfe5880"
version "0.1.0"
license "Apache-2.0"
head "https://github.com/venafi/sigscan.git", branch: "main"
head "https://github.com/venafi/sigscan.git", tag: "v0.1.0"

depends_on "go" => :build
on_macos do
if Hardware::CPU.intel?
url "https://github.com/Venafi/sigscan/releases/download/v#{version}/sigscan-darwin-amd64"
sh256 "6365128a172eb19053eee81d274724e96a29640a9366230e90213183f551e93b"
end

if Hardware::CPU.arm?
url "https://github.com/Venafi/sigscan/releases/download/v#{version}/sigscan-darwin-arm64"
sha256 "8022f6350489c03400ce6cc441d864c747f6d645df47ff60c854e05c3c4dd24e"
end
end

on_linux do
if Hardware::CPU.intel?
url "https://github.com/Venafi/sigscan/releases/download/v#{version}/sigscan-linux-amd64"
sh256 "53c84ff2888f509477cafd903402f8afe51c81912afc451b26bfba42e9107264"
end

if Hardware::CPU.arm?
url "https://github.com/Venafi/sigscan/releases/download/v#{version}/sigscan-linux-arm64"
sha256 "bfbc28191d0717344f2e46ef10e0609272b87e74bcb9e9ee459bb0b26faea0ba"
end
end

def install
system "go", "build", *std_go_args(ldflags: "-s -w")
# Generate and then install man pages
system "go", "run", "./hack/generate-manual"
man1.install Pathname.glob("man/*.1")
# Use the binary to generate shell completions
generate_completions_from_executable(bin/"sigscan", "completion")
cpu = Hardware::CPU.intel? ? "amd64" : "arm64"
os = OS.mac? ? "darwin" : "linux"
bin.install "sigscan-#{os}-#{cpu}" => "sigscan"
end

test do
system "false"
system "#{bin}/sigscan", "version"
end
end
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

## How do I install these formulae?

`brew install venafi/venafi/<formula>`
`brew install venafi/tap/<formula>`

Or `brew tap venafi/venafi` and then `brew install <formula>`.
Or `brew tap venafi/tap` and then `brew install <formula>`.

## Formulae

| Repository | Formula | Description |
| ---------- | ------- | ----------- |
| [sigscan](https://github.com/venafi/sigscan) | [formula](Formula/sigscan.rb) | Inspect container images and other artifacts for signatures |

## Documentation

Expand Down

0 comments on commit adf8f26

Please sign in to comment.