From 264d70856b74ff6e0b4f65c74c83c48d685795ba Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 10 Feb 2021 22:27:44 +0100 Subject: [PATCH] ci: auto-generate changelog --- .chglog/CHANGELOG.tpl.md | 23 +++++++++++++++++++++++ .chglog/config.yml | 23 +++++++++++++++++++++++ .drone.yml | 21 ++++++++++++--------- 3 files changed, 58 insertions(+), 9 deletions(-) create mode 100755 .chglog/CHANGELOG.tpl.md create mode 100755 .chglog/config.yml 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..918b7c0 --- /dev/null +++ b/.chglog/config.yml @@ -0,0 +1,23 @@ +style: github +template: CHANGELOG.tpl.md +info: + title: CHANGELOG + repository_url: https://gitea.rknet.org/docker/molecule +options: + commit_groups: + title_maps: + feat: Features + fix: Bug Fixes + perf: Performance Improvements + refactor: Code Refactoring + chore: Others + ci: CI Pipeline + header: + pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$" + pattern_maps: + - Type + - Scope + - Subject + notes: + keywords: + - BREAKING CHANGE diff --git a/.drone.yml b/.drone.yml index 8dda42d..2c5959e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -30,8 +30,6 @@ steps: - name: dryrun image: thegeeklab/drone-docker-buildx:20 settings: - build_args: - - BUILD_VERSION=${DRONE_TAG%-*} dockerfile: Dockerfile dry_run: true password: @@ -57,11 +55,18 @@ steps: depends_on: - dryrun +- 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} + depends_on: + - tags + - name: publish-dockerhub image: thegeeklab/drone-docker-buildx:20 settings: - build_args: - - BUILD_VERSION=${DRONE_TAG%-*} dockerfile: Dockerfile password: from_secret: docker_password @@ -73,13 +78,11 @@ steps: - refs/heads/main - refs/tags/** depends_on: - - tags + - changelog - name: publish-quay image: thegeeklab/drone-docker-buildx:20 settings: - build_args: - - BUILD_VERSION=${DRONE_TAG%-*} dockerfile: Dockerfile password: from_secret: quay_password @@ -92,7 +95,7 @@ steps: - refs/heads/main - refs/tags/** depends_on: - - tags + - changelog - name: publish-gitea image: plugins/gitea-release @@ -185,6 +188,6 @@ depends_on: --- kind: signature -hmac: eb9f18a96365cbdd00c38b9e2ef210ceee91a147570a6beae469d328f3d6b8a2 +hmac: 9274a1547159dbcd6deb404d5cda31ef411749f396044195219e9b80a59d34ab ...