Get Started With GoReleaser
tech development azure-devops golang devops
GoReleaser
I’m a believer in setting up your project from the very beginning to support CICD.
The key things for this to work:
- Use a task runner for actions.
- This allows the CICD job to call the same essential job you run locally.
- It reduces effort in maintaining a CICD job with inline scripts by having it call the same commands you run locally.
- The CICD service doesn’t become super critical to your job, as it’s just running your task commands, rather than relying on difficult to debug plugins.
- Use versioning such as GitVersion1 or svu2 to allow automatic metadata parsing
- Use tools like GoReleaser3
Why Use GoReleaser
You can get by with a multistage docker build, make build style command, or other basic example. However, if you go with GoReleaser, you’ll save a massive amount of effort to bring CICD into the mix, as it wraps up a lot of functionality that can simplify releases.
Look at the website for a list of plugins.
How I’ve Found It Useful
- Build go locally for Darwin, Linux, and Windows.
- Copy that same binary automatically into a docker container and tag
- Publish this tagged image to AWS ECR or Docker.
- Zip up the artifact and copy to S3 for distribution (including with a little effort automatic github download and install scripts)
Basic Start