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

Publish artifacts #80

Closed
wants to merge 2 commits into from
Closed

Publish artifacts #80

wants to merge 2 commits into from

Conversation

jwilner
Copy link

@jwilner jwilner commented Nov 25, 2020

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

  • Here we target GOOSs linux and darwin, but if Windows support were later added to reflex, goreleaser would support that as well.
  • goreleaser supports automating releases to package managers like brew and snap (with additional customization of course)

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:

Use goreleaser defaults except for:

- Remove windows target as unsupported
- Remove go generate invocation, as unused
- Use both plain binary and archive targets

Additionally, updates documentation to refer to new download paths.
@jwilner
Copy link
Author

jwilner commented Nov 25, 2020

@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
Copy link

mavogel commented May 17, 2021

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
Copy link
Owner

cespare commented Aug 31, 2021

I went a more minimal route in c98fd61.

@cespare cespare closed this Aug 31, 2021
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

Successfully merging this pull request may close these issues.

3 participants