barracuda-cloudgen-access / access-cli

Allows to access all CloudGen Access Enterprise Console APIs from the command line.
Apache License 2.0
10 stars 4 forks source link

fyde-cli on homebrew #15

Closed oNaiPs closed 3 years ago

elyscape commented 4 years ago

Good news: I actually already wrote a Homebrew Formula for this already that you can use as a base for submitting to upstream. It'll need some adjustments once you switch to GoReleaser, but the code that runs on HEAD builds should be a good starting point.

elyscape commented 4 years ago

Updated my formula to work with the new build process.

gbl08ma commented 4 years ago

Thank you so much for the Homebrew formula 👍. We're indeed going to use it as the base for our own, if you don't mind.

We're still discussing how we should approach Homebrew. The current plan is to publish formulas on our own tap, which should be this repo - it should be ready more or less in sync with the next release, which is probably going to be v0.4.2. Once we reach a major stable release (v1.0) we may actually attempt getting added to Homebrew Core, until then, I don't think it makes much sense.

The main challenge is integrating our tap with our CI setup, based on GitHub Actions, as ideally, we'd like the fyde-cli formula to be updated automatically when a new release is created, similar to how artifacts are compiled and added to the release automatically. The complications arise from Actions in this repo not having write access to the tap repo. I have a few ideas on how to solve this, namely by also using GitHub Actions on the tap repo and using repository dispatch events to trigger the update of the formula, but this will require some experimentation, so we'll see how it goes. At a limit, we'll have to update the formula manually every time we make a release - not unlike you would have to update your own personal formula.

elyscape commented 4 years ago

Sounds good to me!

The complications arise from Actions in this repo not having write access to the tap repo.

The following is from the documentation:

If you need a token that requires permissions that aren't available in the GITHUB_TOKEN, you can create a personal access token and set it as a secret in your repository:

  1. Use or create a token with the appropriate permissions for that repository. For more information, see "Creating a personal access token for the command line."
  2. Add the token as a secret in your workflow's repository, and refer to it using the ${{ secrets.SECRET_NAME }} syntax. For more information, see "Creating and using encrypted secrets."

This seems like it might be worth exploring. You'd probably want to create the personal access token on an account owned by the company rather than an individual, but otherwise it should get you there.

gbl08ma commented 4 years ago

v0.4.2 is now released and https://github.com/fyde/homebrew-tap is now operational. For now, it will be manually updated, in sync with each release.

Thanks for your insights on how to automate the process. I had already looked into giving the release workflow in this repo access to our homebrew tap by using another token, but thinking further about this, I'm not sold on the idea of stuffing the workflows on this repo with code to push updates to the tap. It depends on whether we will end up publishing more formulae in the tap, or whether fyde-cli will forever be its sole tenant, but I think that, in the long term, it would make more sense to have the tap "pull" updates from different places, of which this repo would be an example, than to have N different places "pushing" changes to the tap every time a new version of anything is released. That way, any code/scripts/config related to updating the tap formulae could be kept in one place - the tap repo itself.

I'll leave this issue open as the place to discuss anything related to fyde-cli on homebrew, including a possible integration in homebrew-core in the future.

oNaiPs commented 4 years ago

While we don't update the README with installation instructions, i'm leaving them here:

brew tap fyde/tap
brew install fyde-cli

To upgrade:

brew upgrade fyde-cli
gbl08ma commented 4 years ago

The README has been updated with a link to the homebrew tap, where installation instructions are located.