Closed wfg closed 3 months ago
Hey, that's pretty cool, thank you so much!
You were right about it not being that complicated but there are some parts that are a little alien to me and I'd like to make sure I'm comfortable with them before merging. I'll have a play with it and maybe leave some further comments. This will definitely save me a good amount of time though, thank you again!
Happy to help! It was an interesting exercise.
This was the first time I used the goreleaser Docker image build functionality, and I agree, it is a bit unintuitive at first. I did try to organize the sections "chronologically" to help with that (build -> archiving -> image building -> image bundling).
If I can help clear anything up, please let me know.
Finally got to playing with this and after a bunch of fighting with goreleaser I think I got to a state I'm happy with. The only thing I couldn't get working was having just the final multi arch docker image to get pushed rather than it plus all the individual platforms but It's not the end of the world. Thanks again for doing this!
This PR contains everything needed to replace the current build script. It uses GoReleaser to build the Go binary and package it in both archives and Docker multi-arch images.
Assuming this is all new to the reader, there are two new pieces:
.goreleaser.yaml
: This configures goreleaser to mimic the functionality of the existing build script (and extend it to push the Docker image to the GitHub Packages registry for the repository)..github/workflows/releaser.yaml
: This defines the workflow ("pipeline") that runs goreleaser.I won't go line-by-line in each file, but there are a couple things to call out:
You can see an example of everything this provides in my fork.
To produce this example, I only created an empty commit with
git commit -m "Produce example" --allow-empty
and tagged it withgit tag v0.1.0
. Once that was pushed, all of the above happened automatically.I am considering this a draft until reviewed by @svilenmarkov. If and when they approve the idea, I will uncomment the Docker Hub portion of
.goreleaser.yaml
and update theproject_name
variable.