Skip to content

Commit

Permalink
chore: improve generated changelog (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoxys authored May 10, 2021
1 parent 54b3f4a commit b8578cc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
11 changes: 9 additions & 2 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,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',
Expand Down
11 changes: 8 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,18 @@ steps:
commands:
- sha256sum wait-for > 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:
Expand Down Expand Up @@ -359,6 +364,6 @@ depends_on:

---
kind: signature
hmac: e5b493ca16ac60cad643d506e88920384b9c07494d7d0cf854f798a0ca08e2dc
hmac: 2bf0348e9246595526e80674f998395345ba82fb9cb71b1b46daa152c6464b4b

...
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.drone.yml
*.tpl.md

0 comments on commit b8578cc

Please sign in to comment.