Skip to content

Commit

Permalink
Update goreleaser usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ncw committed Jun 26, 2023
1 parent 6564fd8 commit daaa039
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 37 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
/stressdisk_stats.json
/upload
/dist

dist/
51 changes: 51 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
# - go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- windows
- darwin
- linux
- freebsd
- netbsd
goarch:
- amd64
- 386
- arm
- arm64

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- if eq .Os "darwin" }}macOS
{{- else }}{{ .Os }}{{ end }}_
{{- 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
files:
- README.md
- COPYING

checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
33 changes: 0 additions & 33 deletions .goreleaser.yml

This file was deleted.

14 changes: 10 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# Making a release #
# Making a release

Compile and test

Then run

goreleaser --rm-dist --snapshot
goreleaser --clean --snapshot

To test the build

When happy, tag the release

git tag -a v1.0.XX -m "Release v1.0.XX"
git tag -s v1.0.XX -m "Release v1.0.XX"

Push it to github with

git push origin # without --follow-tags so it doesn't push the tag if it fails
git push --follow-tags origin

Then do a release build (set GITHUB token first)

goreleaser --rm-dist
goreleaser --clean

0 comments on commit daaa039

Please sign in to comment.