ci: auto-generate changelog (#31)

* ci: auto-generate changelog

* cleanup
This commit is contained in:
Robert Kaussow 2021-03-23 21:05:59 +01:00 committed by GitHub
parent 799edac507
commit a15339d2a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 68 additions and 21 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/git-batch
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

@ -141,6 +141,15 @@ local PipelineBuildPackage = {
'cd dist/ && 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-github',
image: 'plugins/github-release',

View File

@ -160,6 +160,13 @@ steps:
commands:
- cd dist/ && 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-github
image: plugins/github-release
settings:
@ -533,6 +540,6 @@ depends_on:
---
kind: signature
hmac: 9dfbb0e1e570c1891f0eef862e933b3e98cc268a96808481dd255a0e2fd3a4d7
hmac: b32c128f659518d936c521074313324433254b4c4f0e7f49166e572344542db0
...

3
.gitignore vendored
View File

@ -101,3 +101,6 @@ env*/
.pytest_cache
pip-wheel-metadata
# Misc
CHANGELOG.md

View File

@ -1,20 +0,0 @@
# Changelog
## v0.4.0 (2021-01-03)
### Docs
- add contributing information
### Others
- migrate to poetry
- replace master by main as default branch
* **deps**: pin docker digests ([#6](https://github.com/thegeeklab/git-batch/issues/6))
- **docker**: use standalone dockerfiles for multiarch
- **docker**: switch to org.opencontainers image labels
- use renovate preset config
### Breaking Changes
- drop Python 3.5 support