chore: add goreleaser

This commit is contained in:
Bastien Riviere 2023-09-01 19:13:50 +02:00
parent 83c6fd9734
commit a441943b30
Signed by: babariviere
GPG key ID: 4E5F0839249F162E
4 changed files with 48 additions and 1 deletions

3
.gitignore vendored
View file

@ -32,3 +32,6 @@ result-*
# ---> ntfy-bridge
/config.scfg
# ---> goreleaser
dist/

43
.goreleaser.yaml Normal file
View file

@ -0,0 +1,43 @@
before:
hooks:
- go mod tidy
- go generate ./...
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
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
gitea_urls:
api: https://forge.babariviere.com/api/v1
download: https://forge.babariviere.com
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

View file

@ -41,7 +41,7 @@
};
devShells.default =
pkgs.mkShell {buildInputs = with pkgs; [go gopls];};
pkgs.mkShell {buildInputs = with pkgs; [go gopls goreleaser];};
};
flake = {
};

1
go.sum
View file

@ -1,3 +1,4 @@
git.sr.ht/~emersion/go-scfg v0.0.0-20230828131541-76adf4aeafd7 h1:Cxfw56Srn4yJ2qPUuUvG9qQoQl45U7SsCjSmeTN63Xw=
git.sr.ht/~emersion/go-scfg v0.0.0-20230828131541-76adf4aeafd7/go.mod h1:ybgvEJTIx5XbaspSviB3KNa6OdPmAZqDoSud7z8fFlw=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=