Add release tools, GoReleaser config and chglog config

pull/18/head
James Mills 10 months ago
parent 345d3ee685
commit f926981e02
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6

@ -0,0 +1,22 @@
{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
* {{ .Subject }}
{{ end }}
{{ end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

@ -0,0 +1,37 @@
---
style: Github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://git.mills.io/prologic/msgbus
options:
commits:
filters:
Type:
- Add
- Fix
- Update
- Document
commit_groups:
title_maps:
Add: Features
Update: Updates
Fix: Bug Fixes
Document: Documentation
header:
pattern: "^((\\w+)\\s.*)$"
pattern_maps:
- Subject
- Type
refs:
actions:
- Closes
- Fixes
reverts:
pattern: "^Revert \"([\\s\\S]*)\"$"
pattern_maps:
- Header
notes:
keywords:
- NOTE
- BREAKING CHANGE

2
.gitignore vendored

@ -3,6 +3,8 @@
*.swp
*.prof
**/.DS_Store
/dist
/coverage.txt
/msgbus

@ -1,41 +1,51 @@
---
builds:
-
main: ./cmd/msgbusd/
binary: msgbusd
- id: msgbus
binary: msgbus
main: ./cmd/msgbus
flags: -tags "static_build"
ldflags: -w -X msgbus.Version={{.Version}} -X msgbus.Commit={{.Commit}}
ldflags: >-
-w
-X git.mills.io/msgbus.Version={{.Version}}
-X git.mills.io/msgbus.Commit={{.Commit}}
env:
- CGO_ENABLED=0
goos:
- windows
- darwin
- freebsd
- linux
goarch:
- i386
- amd64
- arm
- amd64
- arm64
goarm:
- 6
- 7
-
main: ./cmd/msgbus/
binary: msgbus
- id: msgbusd
binary: msgbusd
main: ./cmd/msgbusd
flags: -tags "static_build"
ldflags: -w -X msgbus.Version={{.Version}} -X msgbus.Commit={{.Commit}}
ldflags: >-
-w
-X git.mills.io/msgbus.Version={{.Version}}
-X git.mills.io/msgbus.Commit={{.Commit}}
env:
- CGO_ENABLED=0
goos:
- windows
- darwin
- freebsd
- linux
goarch:
- i386
- amd64
- arm
- amd64
- arm64
goarm:
- 6
- 7
sign:
artifacts: checksum
signs:
- artifacts: checksum
release:
gitea:
owner: prologic
name: msgbus
draft: false
gitea_urls:
api: https://git.mills.io/api/v1/

@ -0,0 +1,32 @@
#!/bin/bash
# Get the highest tag number
VERSION="$(git describe --abbrev=0 --tags)"
VERSION=${VERSION:-'0.0.0'}
# Get number parts
MAJOR="${VERSION%%.*}"
VERSION="${VERSION#*.}"
MINOR="${VERSION%%.*}"
VERSION="${VERSION#*.}"
PATCH="${VERSION%%.*}"
VERSION="${VERSION#*.}"
# Increase version
PATCH=$((PATCH + 1))
TAG="${1}"
if [ "${TAG}" = "" ]; then
TAG="${MAJOR}.${MINOR}.${PATCH}"
fi
echo "Releasing ${TAG} ..."
git-chglog --next-tag="${TAG}" --output CHANGELOG.md
git commit -a -m "Update CHANGELOG for ${TAG}"
git tag -a -s -m "Release ${TAG}" "${TAG}"
git push && git push --tags
goreleaser release \
--rm-dist \
--release-notes <(git-chglog "${TAG}" | tail -n+5)
Loading…
Cancel
Save