akavel / up

Ultimate Plumber is a tool for writing Linux pipes with instant live preview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add to homebrew for Mac

miki725 opened this issue · comments

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

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?

commented

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.

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/

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

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!...

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

Maybe someone familiar with go + homebrew can help?

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?

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.

@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.

:( 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).

@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.

@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).

@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 :/

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!

@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!

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

@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.

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.