Skip to content

Commit 5ed56ee

Browse files
committed
chore: add create-release workflow
1 parent 31cdecd commit 5ed56ee

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed

.chglog/CHANGELOG.tpl.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{ range .Versions }}
2+
## Changes
3+
4+
{{ range .CommitGroups -}}
5+
### {{ .Title }}
6+
7+
{{ range .Commits -}}
8+
* {{ .Subject }}
9+
{{ end }}
10+
{{ end -}}
11+
12+
{{- if .RevertCommits -}}
13+
### Reverts
14+
15+
{{ range .RevertCommits -}}
16+
* {{ .Revert.Header }}
17+
{{ end }}
18+
{{ end -}}
19+
20+
{{- if .MergeCommits -}}
21+
### Pull Requests
22+
23+
{{ range .MergeCommits -}}
24+
* {{ .Header }}
25+
{{ end }}
26+
{{ end -}}
27+
28+
{{- if .NoteGroups -}}
29+
{{ range .NoteGroups -}}
30+
### {{ .Title }}
31+
32+
{{ range .Notes }}
33+
{{ .Body }}
34+
{{ end }}
35+
{{ end -}}
36+
{{ end -}}
37+
{{ end -}}

.chglog/config.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
style: github
2+
template: CHANGELOG.tpl.md
3+
info:
4+
title: CHANGELOG
5+
repository_url: https://github.com/YOUR_NAME/REPOSITORY
6+
options:
7+
commits:
8+
filters:
9+
Type:
10+
- feat
11+
- fix
12+
- perf
13+
- refactor
14+
commit_groups:
15+
# title_maps:
16+
# feat: Features
17+
# fix: Bug Fixes
18+
# perf: Performance Improvements
19+
# refactor: Code Refactoring
20+
header:
21+
pattern: "^(\\w*)\\:\\s(.*)$"
22+
pattern_maps:
23+
- Type
24+
- Subject
25+
notes:
26+
keywords:
27+
- BREAKING CHANGE

.github/workflows/release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
create-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Generate changelog
14+
run: |
15+
wget https://github.com/git-chglog/git-chglog/releases/download/0.9.1/git-chglog_linux_amd64
16+
chmod +x git-chglog_linux_amd64
17+
mv git-chglog_linux_amd64 git-chglog
18+
./git-chglog --output ./changelog $(git describe --tags $(git rev-list --tags --max-count=1))
19+
20+
- name: Create Release
21+
id: create-release
22+
uses: actions/create-release@v1
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
tag_name: ${{ github.ref }}
27+
release_name: ${{ github.ref }}
28+
body_path: ./changelog
29+
draft: false
30+
prerelease: false

0 commit comments

Comments
 (0)