chore: improve generated changelog

This commit is contained in:
Robert Kaussow 2021-05-09 22:15:03 +02:00
parent d6e75a39d2
commit 00ac47abe2
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
3 changed files with 27 additions and 7 deletions

View File

@ -1,18 +1,26 @@
# Changelog
{{ range .Versions -}}
## {{ 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 }}
{{ $subjects := list }}
{{ range .Commits -}}
{{ if not (has .Subject $subjects) -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ $subjects = append $subjects .Subject -}}
{{ end }}
{{- end }}
{{- end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}

View File

@ -159,14 +159,21 @@ local PipelineBuildPackage = {
],
},
{
name: 'changelog',
name: 'changelog-generate',
image: 'thegeeklab/git-chglog',
commands: [
'git fetch -tq',
'git-chglog --no-color --no-emoji ${DRONE_TAG:---next-tag unreleased unreleased}',
'git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}',
],
},
{
name: 'changelog-format',
image: 'thegeeklab/alpine-tools',
commands: [
'prettier CHANGELOG.md',
'prettier -w CHANGELOG.md',
],
},
{
name: 'publish-github',
image: 'plugins/github-release',

View File

@ -177,13 +177,18 @@ steps:
commands:
- cd dist/ && sha256sum * > ../sha256sum.txt
- name: changelog
- name: changelog-generate
image: thegeeklab/git-chglog
commands:
- git fetch -tq
- git-chglog --no-color --no-emoji ${DRONE_TAG:---next-tag unreleased unreleased}
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
- name: changelog-format
image: thegeeklab/alpine-tools
commands:
- prettier CHANGELOG.md
- prettier -w CHANGELOG.md
- name: publish-github
image: plugins/github-release
settings:
@ -642,6 +647,6 @@ depends_on:
---
kind: signature
hmac: becc18690731888e4a7b6c93c782df73002dbb7e701e7280cefb19743e830727
hmac: 919f10145586e909500af5dcbbca68b51473ae5e76b5dc1933f2f5383d7f395d
...