Skip to content

Add CD action to update Homebrew formula #138

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

Merged
merged 1 commit into from
Jun 30, 2020

Conversation

vladimyr
Copy link
Contributor

@extrawurst
Copy link
Collaborator

Wow this is magic, I am wondering, is building it from source then? how does it know how to build it? I am such a brew-noob :(

@vladimyr
Copy link
Contributor Author

Yeah it really looks magical but it is really just a large pile of tools/abstractions 😁

I am wondering, is building it from source then?

That is exactly how it works. brew fetches source tarball and executes cargo install:
https://github.com/Homebrew/homebrew-core/blob/616af97/Formula/gitui.rb#L16-L18 All that happens on Homebrew CI servers and resulting binary gets saved or as they say, bottled so end users just download and unpack build matching their platform.
If you ever used (BSD) ports it is pretty much the same pattern except compiling is almost always done on a remote machine and users get precompiled binaries.

how does it know how to build it?

Well, it just executes build step from the install method. The formula is pretty much nothing more than a runnable Ruby class. And this cargo install line is Homebrew's convention available as a template: https://github.com/Homebrew/brew/blob/6b36830/Library/Homebrew/formula_creator.rb#L177-L179 You can specify it by using brew create --rust ....

I am such a brew-noob :(

You should see me doing my first formula. Clueless is a mild word for describing that disaster 😁
I still do not consider myself a Homebrew expert but I learned a trick or two and if you have any additional questions feel free to ask and I hopefully help you find the answers.

@extrawurst
Copy link
Collaborator

Ok thanks for the clarifications. Any idea how to test this? Last time I played around with CD changes it was a mess cause I had to tag multiple releases just because stuff went wrong. People got annoyed because of the spamming this produced 🙈

@vladimyr
Copy link
Contributor Author

I'm afraid I can only point you to create another one 🙈

@vladimyr
Copy link
Contributor Author

@extrawurst
Copy link
Collaborator

extrawurst commented Jun 30, 2020

@vladimyr ok I am getting closer to a new release, so I will pretty soon merge this. one thing I would like to do is keep the 'old' private tap formulae update code around at first. could you adjust this?

@vladimyr
Copy link
Contributor Author

Sure, I'll add that. 👍

@vladimyr vladimyr force-pushed the bump-homebrew-formula branch from ce75113 to 7c43079 Compare June 30, 2020 09:23
@vladimyr
Copy link
Contributor Author

@extrawurst I guess that's it but please double-check token scopes: docs

@extrawurst
Copy link
Collaborator

@vladimyr thanks for looking into this, but I meant the old CI step, not updating the private formula with the new action. I would like to keep the system that worked before inlace and just add the new action that hopefully works for the core-tap

@vladimyr vladimyr force-pushed the bump-homebrew-formula branch from 7c43079 to 8f04f0b Compare June 30, 2020 09:58
@vladimyr
Copy link
Contributor Author

Is this what you want? 🙃

@extrawurst extrawurst merged commit 0e3dfa4 into gitui-org:master Jun 30, 2020
@extrawurst
Copy link
Collaborator

@vladimyr really cool! thank you! ❤️

@vladimyr vladimyr deleted the bump-homebrew-formula branch June 30, 2020 17:32
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

Successfully merging this pull request may close these issues.

2 participants