diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md new file mode 100755 index 0000000..95a8415 --- /dev/null +++ b/.chglog/CHANGELOG.tpl.md @@ -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 -}} diff --git a/.chglog/config.yml b/.chglog/config.yml new file mode 100755 index 0000000..19aef56 --- /dev/null +++ b/.chglog/config.yml @@ -0,0 +1,25 @@ +style: github +template: CHANGELOG.tpl.md +info: + title: CHANGELOG + repository_url: https://github.com/thegeeklab/drone-github-comment +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 diff --git a/.drone.jsonnet b/.drone.jsonnet index 28b07ad..dde33dc 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -114,6 +114,15 @@ local PipelineBuildBinaries = { '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', image: 'plugins/github-release', diff --git a/.drone.yml b/.drone.yml index d07eb59..e968b1a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -86,6 +86,13 @@ steps: commands: - 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 image: plugins/github-release settings: @@ -468,6 +475,6 @@ depends_on: --- kind: signature -hmac: 1216f3597b41f2232f7e7fa734b0df5dc8e977c75ef6eece3f3fb38074d60477 +hmac: ae2c317057edc919a12571358ebe09305828cab50ba6d545dd55b71ed8431988 ... diff --git a/.gitignore b/.gitignore index 624b303..72d0f60 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /drone-github-comment* coverage.out +CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index c1b1d24..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,16 +0,0 @@ -# Changelog - -## v1.0.3 (2021-01-17) - -### Docs - -- add contributing information - -### Others - -- replace master by main as default branch -- **deps**: pin docker digests ([#9](https://github.com/thegeeklab/drone-github-comment/issues/9)) -- **deps**: update golang.org/x/oauth2 commit hash to d3ed898 ([#8](https://github.com/thegeeklab/drone-github-comment/issues/8)) -- **docker**: switch to org.opencontainers image labels -- **deps**: update dependencies -- use renovate preset config