Julien-cpsn / ATAC

A simple API client (postman like) in your terminal
https://atac.julien-cpsn.com/
MIT License
2.02k stars 86 forks source link

Homebrew integration/tap #3

Closed ccoVeille closed 7 months ago

ccoVeille commented 7 months ago

Do you have any plan to support homebrew install?

It's a convenient way to make your tool available for everyone, and it helps to keep the tool up to date

ccoVeille commented 7 months ago

Don't forget how people are lazy 😁

Julien-cpsn commented 7 months ago

Hello (again)! Yes it will be published on homebrew and some other easy-accces packet managers as long as the v1.0.0 comes out (soon I hope) My first target will simply be cargo, so that you can do something like cargo install atac

I am one of those lazy peope :))

Julien-cpsn commented 7 months ago

Update: you can now install/update it with cargo install atac Link to the crates.io for lazy people: https://crates.io/crates/atac

I'll also try with homebrew, nix and some others

Julien-cpsn commented 7 months ago

@ccoVeille ok ok ok I think I got it to work, but unfortunatly I don't have a mac :(

Can you try it and give me some feedback?

brew tap julien-cpsn/atac
brew install atac

PS: In case you wonder (which is normal) here is the homebrew repo https://github.com/Julien-cpsn/homebrew-atac

ccoVeille commented 7 months ago

I don't have a mac either. If I have a lot of money to spend without consideration, it won't be for a mac, haha

ccoVeille commented 7 months ago

You can find the tutorial here https://brew.sh/ it works perfectly on Linux

ccoVeille commented 7 months ago

Everything is good except the atac permission

❯ ls -la /home/linuxbrew/.linuxbrew/Cellar/atac/0.11.2/bin/atac
.r--r--r-- 23M /home/linuxbrew/.linuxbrew/Cellar/atac/0.11.2/bin/atac

But even with executable it doesn't work

❯ chmod +x /home/linuxbrew/.linuxbrew/Cellar/atac/0.11.2/bin/atac

❯ atac
exec: Failed to execute process: '/home/linuxbrew/.linuxbrew/bin/atac' the file could not be run by the operating system.
Julien-cpsn commented 7 months ago

@ccoVeille I am a noob to brew... Should I put the universal-linux archive or the universal-apple archive into the brew tap? (speaking of the archives from my releases)

ccoVeille commented 7 months ago

I have never packaged something into brew, I'm unsure I can help.

I would say you have to do both, one for making the program available for Mac users and one for Linux ones

Julien-cpsn commented 7 months ago

Ok I think I figured it out!

Delete the previous formula and try this one

brew tap julien-cpsn/atac
brew install atac

Works for both my WSL2 and VPS (Debian)

ccoVeille commented 7 months ago

It works well. 👍

ccoVeille commented 7 months ago

Where is the code you used to package it with homebrew?

Julien-cpsn commented 7 months ago

Where is the code you used to package it with homebrew?

The atac-x86_64-unknown-linux-musl.tar.gz in https://github.com/Julien-cpsn/ATAC/releases/tag/v0.11.2 which is built by https://github.com/Julien-cpsn/ATAC/blob/main/.github/workflows/release.yml

ccoVeille commented 7 months ago

This is how the binaries are built. My point was more to know where you told brew a tap was available.

I found it

https://github.com/Julien-cpsn/homebrew-atac

ccoVeille commented 7 months ago

I'm unsure how you could make this automatic via a GitHub action.

Julien-cpsn commented 7 months ago

I think it's possible with a little home-made script that can publish to every platform. Because even if it doesn't seems like, it's a long process to publish a release.

ccoVeille commented 7 months ago

I found these

https://github.com/Homebrew/actions https://til.simonwillison.net/homebrew/auto-formulas-github-actions

ccoVeille commented 7 months ago

I confirm it works as expected

$ brew outdated
==> Auto-updated Homebrew!
==> Updated Homebrew from a553f96c96 to d5d380e1f4.
Updated 1 tap (julien-cpsn/atac).

You have 1 outdated formulae installed.

julien-cpsn/atac/atac (0.11.2) < 0.11.3
$ brew upgrade atac
==> Upgrading 1 outdated package:
julien-cpsn/atac/atac 0.11.2 -> 0.11.3
==> Fetching julien-cpsn/atac/atac
==> Upgrading julien-cpsn/atac/atac
  0.11.2 -> 0.11.3 
🍺  /home/linuxbrew/.linuxbrew/Cellar/atac/0.11.3: 3 files, 12.8MB, built in 1 second
Julien-cpsn commented 7 months ago

Incredible Now I only have to automate it

ccoVeille commented 7 months ago

Yes! The famous "just" ™️ and "only"™️, two development buddies that can lead to work a lot to achieve it.