ci: auto-generate changelog (#7)

This commit is contained in:
Robert Kaussow 2021-02-15 20:52:53 +01:00 committed by GitHub
parent 22b8856206
commit 1870fd9779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 66 additions and 12 deletions

23
.chglog/CHANGELOG.tpl.md Executable file
View File

@ -0,0 +1,23 @@
# 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 }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

25
.chglog/config.yml Executable file
View File

@ -0,0 +1,25 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/thegeeklab/drone-docker
options:
commit_groups:
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
chore: Others
test: Testing
ci: CI Pipeline
docs: Documentation
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE

View File

@ -115,6 +115,15 @@ local PipelineBuildBinaries = {
'cd release/ && sha256sum * > sha256sum.txt', 'cd release/ && sha256sum * > sha256sum.txt',
], ],
}, },
{
name: 'changelog',
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: 'publish', name: 'publish',
image: 'plugins/github-release', image: 'plugins/github-release',

View File

@ -87,6 +87,13 @@ steps:
commands: commands:
- cd release/ && sha256sum * > sha256sum.txt - cd release/ && sha256sum * > sha256sum.txt
- name: changelog
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: publish - name: publish
image: plugins/github-release image: plugins/github-release
settings: settings:
@ -469,6 +476,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: a4e6dd2ab6bcc3383abf1b8cce73ca58834ecb0709a01db887f8cd09ad16050e hmac: 1c7dc109e0955ae8d3e01358642eff449ceb23ce888d35dfed3206060af11db9
... ...

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/drone-docker* /drone-docker*
coverage.out coverage.out
CHANGELOG.md

View File

@ -1,11 +0,0 @@
# Changelog
## v19.03.2 (2021-01-22)
### New Features
- set DOCKER_IMAGE_CREATED as build-arg
### Others
- **deps**: update dependencies