chore: improve generated changelog (#45)

This commit is contained in:
Robert Kaussow 2021-05-09 23:01:34 +02:00 committed by GitHub
parent eaf39178ba
commit 0168a76685
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 6 deletions

View File

@ -6,10 +6,14 @@
{{ range .CommitGroups -}} {{ range .CommitGroups -}}
### {{ .Title }} ### {{ .Title }}
{{ $subjects := list }}
{{ range .Commits -}} {{ range .Commits -}}
{{ if not (has .Subject $subjects) -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} - {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ $subjects = append $subjects .Subject -}}
{{ end }} {{ end }}
{{ end -}} {{- end }}
{{- end -}}
{{- if .NoteGroups -}} {{- if .NoteGroups -}}
{{ range .NoteGroups -}} {{ range .NoteGroups -}}

View File

@ -142,14 +142,21 @@ local PipelineBuildPackage = {
], ],
}, },
{ {
name: 'changelog', name: 'changelog-generate',
image: 'thegeeklab/git-chglog', image: 'thegeeklab/git-chglog',
commands: [ commands: [
'git fetch -tq', '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}', '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', name: 'publish-github',
image: 'plugins/github-release', image: 'plugins/github-release',

View File

@ -160,13 +160,18 @@ steps:
commands: commands:
- cd dist/ && sha256sum * > ../sha256sum.txt - cd dist/ && sha256sum * > ../sha256sum.txt
- name: changelog - name: changelog-generate
image: thegeeklab/git-chglog image: thegeeklab/git-chglog
commands: commands:
- git fetch -tq - 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} - 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 - name: publish-github
image: plugins/github-release image: plugins/github-release
settings: settings:
@ -540,6 +545,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: b32c128f659518d936c521074313324433254b4c4f0e7f49166e572344542db0 hmac: 438c9214d3f09c66e25c1b7dd014e15f21e299a8b1f14cbae00b3dc3e3ed9863
... ...

2
.prettierignore Normal file
View File

@ -0,0 +1,2 @@
.drone.yml
*.tpl.md