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 to homebrew for Mac #10

Closed
miki725 opened this issue Oct 24, 2018 · 19 comments
Closed

Add to homebrew for Mac #10

miki725 opened this issue Oct 24, 2018 · 19 comments
Labels
enhancement New feature or request meta Not really a change to the main code of the app

Comments

@miki725
Copy link

miki725 commented Oct 24, 2018

Given that it works on a mac #6, perhaps it can be submitted to homebrew so installation is super easy on a mac with:

brew install up
@akavel
Copy link
Owner

akavel commented Oct 24, 2018

Right, but can I do that without a Mac? Also, what should I do if I develop the app further, and don't have a Mac handy to test if it still works there after the changes?

@0x62
Copy link

0x62 commented Oct 24, 2018

You don't need a Mac to submit to Homebrew, but it definitely helps.

Have you thought about using a Mac VM online? (e.g. https://www.macincloud.com) They're pretty affordable for testing/debugging, I believe the link above is $1/hr on a Pay As You Go plan.

@miki725
Copy link
Author

miki725 commented Oct 24, 2018

not sure if this is available for free however might be useful to run CI on mac:

https://docs.travis-ci.com/user/reference/osx/

@adamdavis40208
Copy link

https://travis-ci.org/ is free for open source projects

@akavel
Copy link
Owner

akavel commented Oct 24, 2018

Hmm; but then, how would I be able to actually test if it works OK on travis-ci? Given that the whole point of the app is that it's an interactive, console app?... As for purely compilation, Go can do this without needing a VM/CI...

As to $1 per hour for the VM, I'm afraid that's unfortunately 100% too much for me in this case, given that it's purely a hobby project, and I'm already putting my work into it!...

@adamdavis40208
Copy link

I don't know much about it, but found this: https://gist.github.com/mickep76/ca29cca70f0b458aee4d

Maybe someone familiar with go + homebrew can help?

@akavel
Copy link
Owner

akavel commented Oct 25, 2018

Hmmm, maybe https://github.com/JulienPalard/vt100-emulator or https://github.com/selectel/pyte, or some other headless programmable terminal emulator could be run on travis-ci as part of a test suite?

@akavel akavel added the meta Not really a change to the main code of the app label Oct 27, 2018
@gexclaude
Copy link

I just tried and "up" runs on my mac.

In a go project I use https://github.com/goreleaser/goreleaser - it is quite awesome and you can choose which platforms you want / can support and build deliverables for it.

@akavel
Copy link
Owner

akavel commented Oct 28, 2018

@gexclaude In your aaregurucli repo, I see a .goreleaser.yml file with a section brew:, but I'm failing to find any info on this "brew" section in the online docs for goreleaser at https://goreleaser.com; could you be so kind and try to help me understand where can I find some info how to use it? TIA!

edit: Ok, I see now that it seems to be described in the "Customization" section of the docs.

@akavel
Copy link
Owner

akavel commented Oct 28, 2018

:( goreleaser just deleted my meticulously crafted release notes for v0.3 :/ and I don't know how to restore them :/ edit: I submitted an issue report to their repo and rebuilt the notes by hand. The app seems to not fit the way I'm doing releases too well, unfortunately (for example, it refuses to build a homebrew recipe/tap if I want to publish binaries, not a tarball, in my releases).

@gexclaude
Copy link

@akavel I'd suggest to fork your repository for experimenting with goreleaser. I chose to stick to the way goreleaser handles things.

For brew, I just created a new homebrew-tap repository which gets updated by goreleaser.
The formula is not that complex, so you could build it on your own, if you prefer that. See https://github.com/gexclaude/homebrew-tap/blob/master/Formula/aareguru.rb for instance.

@troyanov
Copy link

troyanov commented Nov 8, 2018

@akavel AFAIK Homebrew supports only gzipped tarballs.
If you don't want to mess with goreleaser, you can simply create a tar.gz archive with the binary for MacOS, put it in the Release section, and then just follow the standard approach of adding your Bottle to Homebrew Core (I can help you with it if you want).

@akavel
Copy link
Owner

akavel commented Nov 8, 2018

@troyanov Thanks! ❤️ From the goreleaser docs, section "Homebrew" (thanks to @gexclaude's comment above), I currently seem to understand that to publish to homebrew, I should create a repository https://github.com/akavel/homebrew-up, so I did it. The failed attempts to use goreleaser seem to have uploaded some crippled up.rb file there. Will it be enough if I fill this file appropriately, and upload an "up.tar.gz" file? I realised I could probably upload the file as a release on the homebrew-up repo, not on the main up repo (not to litter the main one with unneeded files). Would that make sense? Is this a "bottle", or is the process different for "bottles"? Or am I doing something wrong in some other way?

I can't seem to be able to find any concrete information in the homebrew docs by myself :( they seem to mention "run homebrew this" and "run homebrew that" everywhere, without mentioning what files I should create if I can't run homebrew :/

@vickio
Copy link

vickio commented Nov 19, 2018

Getting up into Homebrew should be a lot easier than all that. Since it builds easily from source and already runs just fine in macOS, all that needs to happen is for someone to create a "formula" (a Homebrew package definition that has metadata and build instructions) and submit it as a PR to https://github.com/Homebrew/homebrew-core. You don't need a separate repo and you shouldn't try to target macOS binaries. Homebrew CI will build binaries for various macOS versions for people who don't want to build it from source. That's the beauty of Homebrew. In fact, you don't need to do anything at all. I'll put a formula together, test it, and submit it.

up is great by the way, thanks for making it!

@akavel
Copy link
Owner

akavel commented Nov 19, 2018

@vickio Ah wow! "You don't need to do anything at all" — now that's a lovely contribution, thanks a lot! ❤️ :) Also, happy that you like it!

@vickio
Copy link

vickio commented Nov 21, 2018

Homebrew/homebrew-core#34311

@vickio
Copy link

vickio commented Nov 29, 2018

Homebrew has accepted the formula, up can now be installed using brew install up.

@akavel
Copy link
Owner

akavel commented Nov 29, 2018

@vickio :

❤️ Thank you so much! ❤️

If you would like, please feel welcome to add your name to the AUTHORS list in a separate PR (ideally, mentioning this issue in the commit message).

Also: if someone were to update the brew formula for newer versions (in future), is it enough to bump the v0.3.1.tar.gz? Or I suppose the sha256 needs to be updated too, right? Do you know if it can be calculated in some easy way? Though anyway, I suppose the test would need to be run by someone who has brew installed anyway, so it'd be probably for the better if I don't do this myself and just leave it to interested Mac people.

@akavel akavel closed this as completed Nov 29, 2018
@vickio
Copy link

vickio commented Nov 29, 2018

Yes, Homebrew has a brew formula-bump-pr command that any user can run to update the formula to a new version including calculating the checksum. Don’t worry about it, I or some other fan of the program will keep the formula up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request meta Not really a change to the main code of the app
Projects
None yet
Development

No branches or pull requests

7 participants