diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md index 95a8415..3f7457d 100755 --- a/.chglog/CHANGELOG.tpl.md +++ b/.chglog/CHANGELOG.tpl.md @@ -6,10 +6,14 @@ {{ range .CommitGroups -}} ### {{ .Title }} +{{ $subjects := list }} {{ range .Commits -}} +{{ if not (has .Subject $subjects) -}} - {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ $subjects = append $subjects .Subject -}} {{ end }} -{{ end -}} +{{- end }} +{{- end -}} {{- if .NoteGroups -}} {{ range .NoteGroups -}} diff --git a/.drone.jsonnet b/.drone.jsonnet index 0439381..018f2e3 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -86,14 +86,21 @@ local PipelineBuild = { ], }, { - 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-gitea', image: 'plugins/gitea-release', diff --git a/.drone.yml b/.drone.yml index d7412dc..21e389f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -105,13 +105,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-gitea image: plugins/gitea-release settings: @@ -201,6 +206,6 @@ depends_on: --- kind: signature -hmac: 324dc2e7454b73282e8fe95124742fbb10274ac11595f8bd9349a5c9108890f7 +hmac: afaebf7248604450f06f77948cddd98029bc16f6435bcd29a37f132367659069 ... diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..97e0b3e --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +.drone.yml +*.tpl.md