Skip to content

Commit

Permalink
[TOOLS] Use git-chglog for changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
uazo committed Jan 26, 2025
1 parent 9ef7019 commit 9f1ba95
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
14 changes: 14 additions & 0 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})

{{ range .Commits -}}
{{ if not (contains .Type "[") }}- {{.Hash.Short}} {{ .Subject }}
{{ if not (eq (len .Body) 0) }}{{ .Body }}{{ end }}
{{ range .Refs -}}
{{ " " }} - #{{ .Ref }}
{{ end }}
{{ end }}
{{ end }}

{{ end -}}
20 changes: 20 additions & 0 deletions .chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/uazo/cromite
options:
commits:
filters:
Type:
- "[AUTO]"
commit_groups:
# title_maps: []
header:
pattern: "^(\\[.*\\])?(.*)$"
pattern_maps:
- Type
- Subject
notes:
keywords:
- BREAKING CHANGE
12 changes: 5 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ on:
description: 'draft? [true/false]'
required: true
default: 'false'
comment:
description: 'comment'
required: true

env:
CROMITE_SHA: ${{ github.event.inputs.sha }}
REMOVEDOCKERSUPPORT: true
USELOCALIMAGE: true
COMMENT: ${{ github.event.inputs.comment }}

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

0 comments on commit 9f1ba95

Please sign in to comment.