Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add binary packages #48

Open
chevdor opened this issue Jun 30, 2021 · 5 comments
Open

Add binary packages #48

chevdor opened this issue Jun 30, 2021 · 5 comments

Comments

@chevdor
Copy link
Contributor

chevdor commented Jun 30, 2021

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:

@chevdor chevdor mentioned this issue Jun 30, 2021
@Keats
Copy link
Owner

Keats commented Jun 30, 2021

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 chevdor changed the title Add homebrew package Add binary packages Jun 30, 2021
@chevdor
Copy link
Contributor Author

chevdor commented Jun 30, 2021

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
Copy link
Owner

Keats commented Jun 30, 2021

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

@chevdor
Copy link
Contributor Author

chevdor commented Jun 30, 2021

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
Copy link
Contributor Author

chevdor commented Jul 1, 2021

see also #41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants