From 13765e0ea91a2183b12bb1b914ccbb2fd33d3dc0 Mon Sep 17 00:00:00 2001 From: containerscrew <131241415+containerscrew@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:37:20 +0200 Subject: [PATCH] Implement summarize step in build pipeline & add CHANGELOG.md --- .github/workflows/build.yml | 4 + CHANGELOG.md | 251 ++++++++++++++++++++++++++++++++++++ Makefile | 3 + cliff.toml | 28 ++++ 4 files changed, 286 insertions(+) create mode 100644 CHANGELOG.md create mode 100644 cliff.toml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ec395a..7f2f2ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,5 @@ name: Build + on: pull_request: push: @@ -19,3 +20,6 @@ jobs: - name: build run: go build + + - name: Summarize + run: chmod +x ./tftools & ./tftools summarize --compact --show-tags diff --git a/Makefile b/Makefile index 422a986..8ecde43 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,9 @@ gosec: ## Run gosec update-dependencies: ## Update dependencies go get -u ./... +generate-changelog: ## Generate changelog using git cliff + git cliff --output CHANGELOG.md + ##https://github.com/moovweb/gvm ##go get golang.org/x/tools/cmd/goimports ##go install golang.org/x/tools/cmd/goimports diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..2bae838 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,28 @@ +[changelog] +header = """ +# Changelog\n +All notable changes to this project will be documented in this file.\n +""" + +body = """ +{% if version %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + ## [unreleased] +{% endif %}\ +{% for commit in commits | unique(attribute="message") %} + - {{ commit.message | upper_first }} +{% endfor %}\n +""" + +footer = """ + +""" +trim = true + +[git] +conventional_commits = false +filter_unconventional = false +split_commits = false +tag_pattern = "^v[0-9]+\\.[0-9]+\\.[0-9]+$" +sort_commits = "oldest" \ No newline at end of file