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

Consider hosting binaries on Github #11

Closed
jalessio opened this issue Oct 7, 2015 · 16 comments
Closed

Consider hosting binaries on Github #11

jalessio opened this issue Oct 7, 2015 · 16 comments

Comments

@jalessio
Copy link

jalessio commented Oct 7, 2015

For more reliable and persistent hosting you might want to consider hosting the binaries using Github's "Releases" feature. This is a very common practice for packages distributed via homebrew-cask:

Here's a set of examples from the files found in https://github.com/caskroom/homebrew-cask/tree/master/Casks

> grep url * | grep github | head
aether.rb:  url "https://github.com/nehbit/aether-public/releases/download/v#{version}-OSX/Aether.#{version}.dmg"
aluxian-messenger.rb:  url "https://github.com/Aluxian/Facebook-Messenger-Desktop/releases/download/v#{version}/Messenger.dmg"
androidtool.rb:  url "https://github.com/mortenjust/androidtool-mac/releases/download/#{version}/AndroidTool.zip"
angry-ip-scanner.rb:  url "https://github.com/angryziber/ipscan/releases/download/#{version}/ipscan-mac-#{version}.zip"
anybar.rb:  url "https://github.com/tonsky/AnyBar/releases/download/#{version}/AnyBar-#{version}.zip"
apns-pusher.rb:  url "https://github.com/KnuffApp/APNS-Pusher/releases/download/v#{version}/APNS.Pusher.app.zip"
appserver.rb:  url "https://github.com/appserver-io/appserver/releases/download/#{version.sub(/-.*/, '')}/appserver-dist_#{version}_x86_64.pkg"
aptanastudio.rb:  url "https://github.com/aptana/studio3/releases/download/v#{version}/Aptana_Studio_3_Setup_#{version}.dmg"
aquamacs.rb:    url "https://github.com/davidswelt/aquamacs-emacs/releases/download/Aquamacs-#{version}-final/Aquamacs-Emacs-#{version}final.tar.bz2"
aquamacs.rb:    url "https://github.com/davidswelt/aquamacs-emacs/releases/download/Aquamacs-#{version}/Aquamacs-Emacs-#{version}.dmg"

I created an example release in a fork of this repo using the 1.9.1 tag and uploaded the zip file found here which results in the same file available here:
https://github.com/jalessio/MenuMeters/releases/download/1.9.1/MenuMeters_1.9.1.zip

Here's the "releases" page:
https://github.com/jalessio/MenuMeters/releases

And here's a proposed corresponding change to homebrew-cask to adjust to the new URL (just remove the jalessio part to switch it over to your repo):
jalessio/homebrew-cask@60b8e52

This is not essential, but removes the need to host the file yourself (see #7) and provides a long-lived location for all versions of the files. Thanks!

@jalessio jalessio changed the title Consider hosting binaries on Github for homebrew-cask Consider hosting binaries on Github Oct 7, 2015
@onpaws
Copy link

onpaws commented Oct 7, 2015

+1 MenuMeters on Homebrew

Sent from my Banana Phone

On Oct 7, 2015, at 14:30, Jamie Alessio notifications@github.com wrote:

For more reliable and persistent hosting you might want to consider hosting the binaries using Github's "Releases" feature. This is a very common practice for packages distributed via homebrew-cask:

Here's a set of examples from the files found in https://github.com/caskroom/homebrew-cask/tree/master/Casks

grep url * | grep github | head
aether.rb: url "https://github.com/nehbit/aether-public/releases/download/v#{version}-OSX/Aether.#{version}.dmg"
aluxian-messenger.rb: url "https://github.com/Aluxian/Facebook-Messenger-Desktop/releases/download/v#{version}/Messenger.dmg"
androidtool.rb: url "https://github.com/mortenjust/androidtool-mac/releases/download/#{version}/AndroidTool.zip"
angry-ip-scanner.rb: url "https://github.com/angryziber/ipscan/releases/download/#{version}/ipscan-mac-#{version}.zip"
anybar.rb: url "https://github.com/tonsky/AnyBar/releases/download/#{version}/AnyBar-#{version}.zip"
apns-pusher.rb: url "https://github.com/KnuffApp/APNS-Pusher/releases/download/v#{version}/APNS.Pusher.app.zip"
appserver.rb: url "https://github.com/appserver-io/appserver/releases/download/#{version.sub(/-.*/, '')}/appserver-dist_#{version}_x86_64.pkg"
aptanastudio.rb: url "https://github.com/aptana/studio3/releases/download/v#{version}/Aptana_Studio_3_Setup_#{version}.dmg"
aquamacs.rb: url "https://github.com/davidswelt/aquamacs-emacs/releases/download/Aquamacs-#{version}-final/Aquamacs-Emacs-#{version}final.tar.bz2"
aquamacs.rb: url "https://github.com/davidswelt/aquamacs-emacs/releases/download/Aquamacs-#{version}/Aquamacs-Emacs-#{version}.dmg"
I created an example release in a fork of this repo using the 1.9.1 tag and uploaded the zip file found here which results in the same file available here:
https://github.com/jalessio/MenuMeters/releases/download/1.9.1/MenuMeters_1.9.1.zip

Here's the "releases" page:
https://github.com/jalessio/MenuMeters/releases

And here's a proposed corresponding change to homebrew-cask to adjust to the new URL (just remove the jalessio part to switch it over to your repo):
jalessio/homebrew-cask@60b8e52

This is not essential, but removes the need to host the file yourself and provides a long-lived location for all versions of the files. Thanks!


Reply to this email directly or view it on GitHub.

@jalessio
Copy link
Author

jalessio commented Oct 7, 2015

FYI - @onpaws @yujitach's version of MenuMeters is already available via homebrew:

brew update
brew cask install yujitach-menumeters

This is just a proposal to change the location of the binaries homebrew refers to.

@yujitach
Copy link
Owner

yujitach commented Oct 8, 2015

Thanks for the suggestion. I live in stone age and am still using macports, and not familiar with homebrew I have to shamefully admit :p Where can I learn the basics of homebrew, in particular the code-sign guidelines for the released binaries?

As for the server, it's the website of the university I permanently work on, so it should be pretty long-lived (in fact it's slightly older than GitHub itself ...)

@jalessio
Copy link
Author

jalessio commented Oct 8, 2015

@yujitach what do you mean by the "code-sign guidelines for the released binaries"? Are you referring to the OS X code signing described here? If so, I don't think that is required for Homebrew Cask installation. Your current binaries are working just fine via Homebrew Cask.

In any case, if you'd prefer to host the binaries on your university's server that's all fine and good. I was just suggesting a free and zero maintenance option but sounds like you might already have those two attributes taken care of 😄

@yujitach
Copy link
Owner

yujitach commented Oct 8, 2015

Well the binary on the other website is signed by my paid-developer certificate so that it's accepted by anybody's mac. But the certificate and the signing process is intentionally left out from the public code on the github. Anyway, it's a good time for me to learn how to use homebrew, thanks for the suggestion.

@jalessio
Copy link
Author

jalessio commented Oct 8, 2015

Ah, that part was "magic" to me. You can just take your binary and upload/attach it to the github release using github's web UI. That's all I did. Nothing magic from me.

@ranek
Copy link

ranek commented Oct 10, 2015

It might help things crystallize by being clear about the distinction between the core Homebrew project and Homebrew Cask. Homebrew helps download and build packages from source, and as you suspect, these packages (or their precompiled "bottles") are not typically code signed.

Homebrew Cask, on the other hand, automates the action of downloading official binaries of Mac apps, and moving them to an "installed" destination (in this case, ~/Library/PreferencePanes). As you'll see in the cask, there is no reference to your source code at all; only a link to the download file.

You can, of course, host your compiled and signed binaries anywhere you like. GitHub's Releases just happen to have some nice properties: they're tied to a tag in Git that clearly marks the source they're derived from, served over TLS, accompanied by release notes, and hosted on infrastructure that may offer higher bandwidth and availability than your university's server.

@yujitach
Copy link
Owner

Thank you for the clarifications, @ranek. Let me ask one more: as my El Capitan port is hosted on GitHub, isn't it more reasonable to put it to as an entry in Homebrew, instead of as an entry in Homebrew-cask?

@ranek
Copy link

ranek commented Oct 13, 2015

That's a great question. Homebrew's policy is to focus on command line tools and libraries. See Acceptable Formulae for more details.

@yujitach
Copy link
Owner

Ah, thanks for explaining it.

@ronubi
Copy link

ronubi commented Oct 21, 2015

Thanks for the brew-cask command line, @jalessio – work great, and seems to have picked up my old MenuMeters prefs.

(I was just about to shell out $18 for iStatMenu.)

@karlhorky
Copy link

GitHub's Releases just happen to have some nice properties ... served over TLS

+1 for hosting the binaries on GitHub Releases. It doesn't appear that member.ipmu.jp offers the download over https.

@pydolan
Copy link

pydolan commented Dec 14, 2015

+1. Thanks!

@BenjaminHCCarr
Copy link

+1

@HongPong
Copy link

HongPong commented Sep 4, 2016

I would just add this key homebrew cask info to the repo description so it's right there. Thanks a ton for this!

@yujitach
Copy link
Owner

I decided to put the releases on the GitHub too: https://github.com/yujitach/MenuMeters/releases . Thank you for complaining to me.

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

9 participants