From 7d3b6632c19dd075cb3283345880bf16b414ed4f Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Sat, 2 Nov 2024 09:47:40 -0400 Subject: [PATCH] Add goreleaser configuration Signed-off-by: Daniel Mikusa --- .goreleaser.yaml | 35 +++++++++++++++++++++++++++++++++++ README.md | 11 +++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .goreleaser.yaml diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..80f1dd3 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,35 @@ +version: 2 + +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" diff --git a/README.md b/README.md index a2f2f44..9ddd998 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,17 @@ Flags: --version string the new version of the dependency ``` +## Making a Release + +The project uses Goreleaser for release management. The following steps can be used to cut a release. + +1. Tag a new release. `git tag -a vX.Y.Z -m "vX.Y.Z Release"` +2. Push up the tag. `git push origin vX.Y.Z` +3. Set Github Token. `export GITHUB_TOKEN=` +4. Run Goreleaser. `goreleaser release` + +You can install Goreleaser with `brew install goreleaser`. + ## License This library is released under version 2.0 of the [Apache License][a].