Skip to content

Commit 9f1ba95

Browse files
committed
[TOOLS] Use git-chglog for changelog
1 parent 9ef7019 commit 9f1ba95

File tree

3 files changed

+39
-7
lines changed

3 files changed

+39
-7
lines changed

.chglog/CHANGELOG.tpl.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{ range .Versions }}
2+
<a name="{{ .Tag.Name }}"></a>
3+
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
4+
5+
{{ range .Commits -}}
6+
{{ if not (contains .Type "[") }}- {{.Hash.Short}} {{ .Subject }}
7+
{{ if not (eq (len .Body) 0) }}{{ .Body }}{{ end }}
8+
{{ range .Refs -}}
9+
{{ " " }} - #{{ .Ref }}
10+
{{ end }}
11+
{{ end }}
12+
{{ end }}
13+
14+
{{ end -}}

.chglog/config.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
style: github
2+
template: CHANGELOG.tpl.md
3+
info:
4+
title: CHANGELOG
5+
repository_url: https://github.com/uazo/cromite
6+
options:
7+
commits:
8+
filters:
9+
Type:
10+
- "[AUTO]"
11+
commit_groups:
12+
# title_maps: []
13+
header:
14+
pattern: "^(\\[.*\\])?(.*)$"
15+
pattern_maps:
16+
- Type
17+
- Subject
18+
notes:
19+
keywords:
20+
- BREAKING CHANGE

.github/workflows/release.yaml

+5-7
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ on:
1717
description: 'draft? [true/false]'
1818
required: true
1919
default: 'false'
20+
comment:
21+
description: 'comment'
22+
required: true
2023

2124
env:
2225
CROMITE_SHA: ${{ github.event.inputs.sha }}
2326
REMOVEDOCKERSUPPORT: true
2427
USELOCALIMAGE: true
28+
COMMENT: ${{ github.event.inputs.comment }}
2529

2630
jobs:
2731
release:
@@ -48,9 +52,6 @@ jobs:
4852
BRANCH=$(curl https://github.com/uazo/cromite/branch_commits/$CROMITE_SHA | ./pup -p li.branch:last-child a text{} | xargs)
4953
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
5054
51-
wget https://github.com/cli/cli/releases/download/v2.18.1/gh_2.18.1_linux_amd64.tar.gz
52-
tar xfz gh_2.18.1_linux_amd64.tar.gz
53-
5455
- name: Checkout 'uazo/cromite'
5556
uses: actions/checkout@v2
5657
with:
@@ -71,10 +72,7 @@ jobs:
7172
7273
echo ${{ secrets.GITHUB_TOKEN }} | $GH auth login --with-token
7374
74-
echo "\`\`\`" >note
75-
# echo "this is not the official release of bromite but a test version." >>note
76-
# echo "you can try it at your own risk." >>note
77-
echo "\`\`\`" >>note
75+
echo $COMMENT >note
7876
7977
$GH release create $VERSION-$CROMITE_SHA --notes-file note -d
8078

0 commit comments

Comments
 (0)