y-taka-23 / thank-you-stars

Give your dependencies stars on GitHub! 🌟
https://hackage.haskell.org/package/thank-you-stars
BSD 3-Clause "New" or "Revised" License
106 stars 2 forks source link

release binary #6

Open unhammer opened 1 year ago

unhammer commented 1 year ago

This program could be useful for people who don't have the right haskell toolchain installed. It would make sense to put precompiled binaries in the Github release for those people (also haskellers who don't feel like waiting for the compilation).

It's possible to do it as github actions: https://vrom911.github.io/blog/github-actions-releases

y-taka-23 commented 1 year ago

Thanks for your feedback! It sounds nice, and I'm also interested in why you require the precompiled binary. Perhaps the potential users of the tool have a development environment for Haskell. Did you have any troubles with the build? Or just because the build process is boring?

unhammer commented 1 year ago

Oh I don't require it, just a suggestion :) I do have a Haskell dev env myself, but even so it's a rather high barrier of entry for a program that I is more of a "nice to have" than "need to have". For my own part, I prefer using nix with Haskell to avoid compiling so many dependencies, but then I needed to copy and modify a default.nix from one of my own projects (since I can't remember all the nixlang intricacies) and disable tests ( uncaught exception: NoHackageTarballFound probably because of nix). I'm guessing most people without GHC 8.10 installed will not bother with investigating how to get a dev env up ("First step: do you want ghcup+cabal, or stack, or nix? Read these blog posts arguing the merits of each").

y-taka-23 commented 1 year ago

Okay, I got it. I will try it by GitHub Actions, manual, or anything else.

y-taka-23 commented 1 year ago

@unhammer What do you think about releasing the tool not as a naked binary but as a container? To distribute binary executables, I need to tie the dependencies statically for each environment but;

unhammer commented 1 year ago

A release.yml like https://github.com/unhammer/bin-your-stars/commit/f65c7e7ae9773845155e7d9dbab8dde2d6b68d27 (based on the one from stan) along with RW Workflow permissions gives Linux and macos binaries at least, looking like https://github.com/unhammer/bin-your-stars/releases/tag/v1.0.11 (For some reason cabal fails to figure out the deps on Windows? cf. bottom of this log.)

But yes, they're not statically linked (I've not looked into how to do that). Containers sounds a bit overkill to me, but if the osx dynamic binaries can't be distributed maybe it's the best option …

y-taka-23 commented 1 year ago

@unhammer

Containers sound a bit overkill to me

Hmm, I'm afraid so, too. But anyway, I tried to build an image. Could you taste it by the following command?

https://github.com/y-taka-23/thank-you-stars/pkgs/container/thank-you-stars

docker run \
  -v $PWD:/home/nonroot/project \
  -v $HOME/.thank-you-stars.json:/home/nonroot/.thank-you-stars.json \
  -v $HOME/.cabal:/home/nonroot/.cabal \
  ghcr.io/y-taka-23/thank-you-stars:latest
y-taka-23 commented 1 year ago

@unhammer ping; If you are okay, I will document it on README.md and refine the CI. :)

unhammer commented 1 year ago

Sorry, big inbox here :) That docker command does work on my end, yes!

Btw if you're editing README anyway, I had to cp ~/.stack/pantry/hackage/00-index.tar ~/.cabal/packages/hackage.haskell.org/00-index.tar since I guess stack stores its own version; got NoHackageTarballFound otherwise.