kickstart icon indicating copy to clipboard operation
kickstart copied to clipboard

Add binary packages

Open chevdor opened this issue 3 years ago • 5 comments

It would be nice having a homebrew binary package for MacOS users. Scaffolding is especially useful for beginner users and they may not have the rust toolchain installed.

I did just that for the https://github.com/chevdor/tera-cli project and use... Tera to do the work :)

The template is rather simple: https://github.com/chevdor/tera-cli/blob/master/templates/formula.rb The CI doing that part is located here: https://github.com/chevdor/tera-cli/blob/master/.github/workflows/release.yml#L94

NOTE: I am using using a specific feature of chevdor/tera-cli in this CI: that is the support for ENV. For (probably too little) details, see:

  • https://github.com/chevdor/tera-cli#env-support
  • https://github.com/chevdor/tera-cli#env-only

chevdor avatar Jun 30 '21 10:06 chevdor

I'm not planning to handle it myself, I just can't deal with all the packages I have but someone else could manage it like Zola.

Keats avatar Jun 30 '21 11:06 Keats

I renamed the issue because it concerns binaries in general, not only MacOS ones. I would gladly help you with github CI as I have done for other projects but I am not familiar with Azure pipelines. A good start would be to add the binaries as artifacts to the releases. Things like Homebrew formulas can then be made in other repos and point at the official binaries.

chevdor avatar Jun 30 '21 12:06 chevdor

Binaries are available on the releases: https://github.com/Keats/kickstart/releases

Keats avatar Jun 30 '21 12:06 Keats

Hmmm not sure why I missed them...

So FYI, you seem to not miss much to expose kickstart as a Homebrew tap: For a Homebrew formula, you need to generate (or make manually) such a file:

class Kickstart < Formula
  desc "some description"
  homepage "https://github.com/Keats/kickstart"
  url "https://github.com/Keats/kickstart/releases/download/v0.2.1/kickstart-v0.2.1-x86_64-apple-darwin.tar.gz"
  sha256 "40217f7edc3ccc76e9e1f81a6f05629f109d4ab9587ccd9a2d8031b6b844d02b"
  version "0.2.1"

  def install
    bin.install "kickstart"
  end
end

The only moving parts are:

  • url
  • sha256
  • version

This needs to be hosted in a repo under a Formula folder. So all that is missing is the sha256.

As far as hosting is concerned, homebrew recommends a separate repo called in your case homebrew-kickstart. I am not a fan (personally) of having to manage yet another ci in another repo. So I prefer hosting the Formula folder in the main repo. The users have a type a slightly longer command to install but this is done once only.

To be honnest, a simple template to generate the Formula above does not really need Tera or tera-cli, and envsubst would work as well on *nix systems (not sure about windows), saving you one dependency.

chevdor avatar Jun 30 '21 12:06 chevdor

see also #41

chevdor avatar Jul 01 '21 08:07 chevdor