From 7a3fd6de68462fb64266bf3f606e957d32cdc2ae Mon Sep 17 00:00:00 2001 From: axetroy Date: Tue, 24 Nov 2020 07:27:26 +0800 Subject: [PATCH] ci: add release template --- .github/workflows/build.yml | 6 +----- release.tpl | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 release.tpl diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7ae748a..884f0833 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,13 +54,9 @@ jobs: with: fetch-depth: 0 - - run: | - ls -lsa ./.git - git --no-pager log - - name: Generate release.md run: | - ./run.sh --file=release.md + ./run.sh --tpl=release.tpl --file=release.md - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 diff --git a/release.tpl b/release.tpl new file mode 100644 index 00000000..d419a3b1 --- /dev/null +++ b/release.tpl @@ -0,0 +1,33 @@ +{{- define "body" -}} +{{range . -}} +- {{if .Field.Header.Scope }}**{{ unescape .Field.Header.Scope }}**: {{ end }}{{ unescape .Field.Header.Subject }}({{ hashURL .Hash}}) (thanks @{{ unescape .Author.Name }}){{if .Field.Footer }} {{if .Field.Footer.Closes }}, Closes: {{ stringsJoin .Field.Footer.Closes "," }} {{- end }} {{- end}} +{{ end }} +{{- end -}} + +{{if .Feat}} +### 🔥 New feature: +{{ template "body" .Feat }} +{{ end }} + +{{if .Fix}} +### 🐛 Bugs fixed: +{{ template "body" .Fix }} +{{ end }} + +{{if .Perf}} +### ⚡️ Performance improves: +{{ template "body" .Perf }} +{{ end }} + +{{if .BreakingChanges}} +### ❤ BREAKING CHANGES: +{{ range .BreakingChanges -}} +- {{if .Field.Footer.BreakingChange.Title}}{{ unescape .Field.Footer.BreakingChange.Title }}{{ else }}{{ unescape .Field.Title }}{{ end }} +{{ unescape .Field.Footer.BreakingChange.Content }} +{{- end -}} +{{ end }} + +### 💪 Commits({{ len .Commits }}): +{{range .Commits -}} +- {{ hashURL .Hash}} - {{ unescape .Field.Title }} +{{ end }} \ No newline at end of file