Skip to content

Commit

Permalink
ci: add release template
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Nov 23, 2020
1 parent 00d6cc7 commit 7a3fd6d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 33 additions & 0 deletions release.tpl
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 7a3fd6d

Please sign in to comment.