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 publishing to homebrew? #95

Open
chmac opened this issue Mar 3, 2022 · 12 comments
Open

Consider publishing to homebrew? #95

chmac opened this issue Mar 3, 2022 · 12 comments

Comments

@chmac
Copy link

chmac commented Mar 3, 2022

I was searching for ping apps on homebrew but didn't find pingnoo there, found it via alternativeto.net instead.

Would you be open to publishing on homebrew? I can lend a hand if that helps, I've tried (and failed) to help joplin publish to homebrew. But hopefully pingnoo would be simpler. :-)

@fizzyade
Copy link
Member

fizzyade commented Mar 3, 2022 via email

@chmac
Copy link
Author

chmac commented Mar 3, 2022

Awesome. I think it would also require an extra step when every version is released to tell brew about the new version.

Brew is traditionally for command line applications and then they call regular applications "casks". I'm used to installing (and updating) most of my free software through brew. Makes it easy to track updates across my whole system.

@fizzyade
Copy link
Member

fizzyade commented Mar 3, 2022 via email

@chmac
Copy link
Author

chmac commented Mar 4, 2022

Ok, I submitted a PR to add the cask Homebrew/homebrew-cask#120000

To update, the version parameter in the Casks/pingnoo.rb file in the homebrew-cask repo needs to be updated and then the new sha256 value for the new .dmg file also updated. I'm not really sure how you would automate this process within your teamcity process as I'm not familiar with it. Is that something you could look into (assuming that the cask is accepted)?

Also, I assumed that the "latest" version is the one tagged "Latest" on GitHub and not what the website downloads. I setup a version check in the cask file based on that assumption also. #96

@fizzyade
Copy link
Member

fizzyade commented Mar 4, 2022 via email

@chmac
Copy link
Author

chmac commented Mar 4, 2022

Sorry to hear you've been unwell.

Let's see if brew accept the cask. It should be fairly easy to document how to update the cask, but the method requires opening a PR on GitHub, so I guess that it's probably easier to do it manually rather than try and script it.

@chmac
Copy link
Author

chmac commented Mar 8, 2022

Some feedback on the PR, we're hitting an issue with the versioning, not sure what the solution will be, but will report back.

@chmac
Copy link
Author

chmac commented Mar 8, 2022

Okay, I think everything has been sorted out and the PR should land. So that'll put the current "Latest" version from GitHub into brew. In theory, to release a new version to homebrew, you'll need to open a Pull Request against the homebrew-cask repo which updates the version and sha256 values in the Casks/pingnoo.rb file. I'd assume that it's simpler to do that by hand than it is to automate it, especially the part about opening a PR, I guess that's hard to script. What do you think?

@fizzyade
Copy link
Member

fizzyade commented Mar 9, 2022 via email

@chmac
Copy link
Author

chmac commented Mar 9, 2022

Fair enough, totally up to you.

I think the steps are:

  • Fork the homebrew-cask repo
  • Create a new branch
  • Update the version and sha256 values in Casks/pingnoo.rb
    • version gets the latest version string
    • sha256 gets the sha256 value of the .dmg file
  • Commit
  • Create a pull request

The pull request has a format, and there's a series of tasks which should be completed. Like running brew audit and other commands. But there's also a load of checks run when you open the PR. I'm not sure how you'd want to approach that, whether you run all those tasks and then update the PR body, or write some code to check that the tasks haven't changed, etc. Here's the current text of the new PR template:

**Important:** *Do not tick a checkbox if you haven’t performed its action.* Honesty is indispensable for a smooth review process.

_In the following questions `<cask>` is the token of the cask you're submitting._

After making all changes to a cask, verify:

- [ ] The submission is for [a stable version](https://docs.brew.sh/Acceptable-Casks#stable-versions) or [documented exception](https://docs.brew.sh/Acceptable-Casks#but-there-is-no-stable-version).
- [ ] `brew audit --cask <cask>` is error-free.
- [ ] `brew style --fix <cask>` reports no offenses.

Additionally, **if adding a new cask**:

- [ ] Named the cask according to the [token reference](https://docs.brew.sh/Cask-Cookbook#token-reference).
- [ ] Checked the cask was not [already refused](https://github.com/Homebrew/homebrew-cask/search?q=is%3Aclosed&type=Issues).
- [ ] Checked the cask is submitted to [the correct repo](https://docs.brew.sh/Acceptable-Casks#finding-a-home-for-your-cask).
- [ ] `brew audit --new-cask <cask>` worked successfully.
- [ ] `brew install --cask <cask>` worked successfully.
- [ ] `brew uninstall --cask <cask>` worked successfully.

@fizzyade
Copy link
Member

fizzyade commented Mar 9, 2022 via email

@chmac
Copy link
Author

chmac commented Mar 11, 2022

Btw, I just saw a PR which said "Created with brew bump-formula-pr.", so maybe the tooling already exists to automate this...

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