See https://goreleaser.com/quick-start/.
zig-releaser is a hack that allows Zig programs to be built, packaged, and released with GoReleaser, a tool for publishing Go programs.
Here is an example for a Zig program published to GitHub with GoReleaser. The changelog and artefacts are all automatically generated by GoReleaser. This hack has only been tested with GitHub but should work with other release targets GoReleaser supports.
-
Install GoReleaser.
-
Setup the GitHub token with
repoperms. -
Copy
.goreleaser/, and.goreleaser.ymlfrom this repo to the root of the Zig project. -
Edit
.goreleaser.ymlfor the project (generally thebinary,goos,filesfields). -
Edit
build.shscript to tweak the zig build flags.
Once the project is ready for release, add a semver tag (git tag -a v0.1.0 -m v0.1.0)
goreleaser --snapshot --skip=publish --cleanThe releases will appear in the dist directory.
goreleaser --snapshot --skip=publish --clean