cespare / reflex

Run a command when files change
MIT License
3.35k stars 135 forks source link

Publish artifacts #80

Closed jwilner closed 3 years ago

jwilner commented 3 years ago

Publish Artifacts

This PR is a one-stop shop for publishing binaries and archives. Adoption is simple:

  1. merge this PR
  2. push a tag:
git tag -a -m "Publish build artifacts" v0.4.0
git push --tags

TL;DR

This PR adds popular tool GoReleaser and GitHub actions to automatically publish unwrapped binaries, .tar.gz archives, and checksums for MacOS and Linux to GitHub releases whenever a tag is pushed. Example output is visible in the fork's releases page.

Targets

I added targets for both plain binaries and archives. The plain binaries themselves clock in at ~2MB, so there's not much value to the compression of the archives, but the archives also send along the license and README. Checksums for everything are included.

Tech Choices

This PR adopts some very common and popular technology for this project.

GoReleaser

goreleaser is a very popular and extensible tool for automating release cycles. It is itself a CLI binary, but here we use its GitHub action (Docker container) to make the process as automated as possible. Currently, we define two targets -- vanilla binaries and tar.gzs of a directory containing the license, README, and binary.

Flexibility

GitHub Actions

GitHub Actions is the most accessible CI/CD platform for a GitHub repository, as with this project.

GitHub Releases

Again, GitHub releases are the most accessible place to store your build artifacts when you've got a GitHub repository. Speaking as a GitHub user, I suspect it's the first place most people look for downloads.

Related issues:

jwilner commented 3 years ago

@cespare please let me know if there's anything I can do to help get this in place. Tried to make it as simple as possible, and this would be a real boon to my team and others, I'm sure. (and thanks for the great tool!)

mavogel commented 3 years ago

ping @cespare :) Feel also free to add co-maintainers to help you offload some work. We did this for https://github.com/git-chglog/git-chglog as well.

cespare commented 3 years ago

I went a more minimal route in c98fd61ee5cf44a5988cc0394b600fd515474164.