Keats / kickstart

A scaffolding tool to get new projects up and running quickly
MIT License
354 stars 24 forks source link

Add binary packages #48

Open chevdor opened 3 years ago

chevdor commented 3 years ago

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:

Keats commented 3 years ago

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.

chevdor commented 3 years ago

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.

Keats commented 3 years ago

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

chevdor commented 3 years ago

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:

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 commented 3 years ago

see also #41