capactio / capact

Simple way to manage applications and infrastructure.
https://capact.io
Apache License 2.0
80 stars 19 forks source link

Generate and publish a homebrew-tap recipe for Capact CLI #587

Closed mszostok closed 2 years ago

mszostok commented 2 years ago

Description

Generate and publish a homebrew-tap recipe for Capact CLI, so we can install it via brew:

brew tap capactio/homebrew-tap # not sure which repo will be the best, maybe a separate one?
brew install capactio/homebrew-tap/capact-cli

(registering tap may be optional)

To achieve that, we can use https://goreleaser.com/customization/homebrew/

OR if possible, add it to homebrew core:

brew install capact-cli

See: https://docs.brew.sh/Acceptable-Formulae. Probably we should start with tap and later move to core.

Reason

Simply installation on macOS, and improve UX.

Use cases

AC

mkuziemko commented 2 years ago

Findings

  1. In the goreleaser we use:
    no_unique_dist_dir: true

I tried to not modify this setting but the binary name in the generated formula is inconvenient. Example

  on_linux do
    if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
      url "https://github.com/mkuziemko/capact/releases/download/v0.7.0/capact-linux-arm64-linux-arm64"
      sha256 "fbfe976e62b93245f72814176efd7c5f08714ba4c3b4c40f27130bc5fc4929d6"

      def install
        bin.install "capact-linux-arm64-linux-arm64" => "capact-linux-arm64"
      end
    end
    if Hardware::CPU.intel?
      url "https://github.com/mkuziemko/capact/releases/download/v0.7.0/capact-linux-amd64-linux-amd64"
      sha256 "4d0eaacf485eee75b00a4ede388020c5753241544a9b2220c9f7f46b22b57837"

      def install
        bin.install "capact-linux-amd64-linux-amd64" => "capact-linux-amd64"
      end
    end
  end

This has an impact on the hierarchy in which binaries are located in Google Storage as we use rsync in bin directory.

  1. One of the rules is to have the homebrew- prefix in the repository name for homebrew tap. For that reason, I created a new repository: https://github.com/capactio/homebrew-tap

PRs

Here is a list of PR ready for review: