Try out GoReleaser for release process
https://goreleaser.com/intro/
In the limitations, goreleaser mentions CGO, that is going to be important when we add CGO and non-CGO binaries, for supporting things like YubiKey and PKCS#11 modules in the cli. But it links to this project https://github.com/troian/golang-cross
I've written a basic .goreleaser.yml that builds multiarch binaries, archives, and docker images (non-CGO) using our naming & dir structure conventions.
To try it:
- Install GoReleaser on your machine
- Checkout branch
carl/goreleaser. - Run
goreleaser --snapshot --skip-publish --rm-dist - See the output in the
distfolder.
Notes:
- GoReleaser will build files with a
vprefix before the version number eg.step_linux_v0.15.4-rc.4-next_amd64.tar.gz. This is a goreleaser bug, but it only does this for snapshot builds; for actual releases it will not include thevprefix. - I changed the
Dockerfileto stop buildingstepinside the container. This may breakstep-ca's docker build process - And, when we need CGO support, we'll need to build inside containers anyway.
TODOs to replace current Makefile/GH Actions build process:
- [x] Configure source archive for the Homebrew packager (see our current
make archiverule) - [x] Configure Scoop packaging
- [x] Move to GitHub Actions workflow (see GoReleaser official GH action and GoReleaser GitHub Actions doc)
- [x] Add darwin arm64 support (will require Go 1.16)
- [x] Test GitHub release creation & Scoop packagers
- [x] Configure GitHub release creation
- [x] Build with
-trimpath
(What else?)
Version 2:
- [ ] Review Docker build — do we push to registries other than DockerHub?
- [ ] Add CGO support (this will be a fair bit of work - see this Medium post and this issue)
- [ ] Add Homebrew deployment (this will require step & step-ca pkgs to be separated out & configured w/dependencies. And if we are going to do that, it will make sense to move certificates to GoReleaser first)
Is it possible to build with -trimpath?
@maraino yes— I've added this.