Skip to content

Commit 88f14bf

Browse files
authored
✨ auto changelog (#80)
Here goes nothing 🤞. Please CI don't fail me.
1 parent 47a11e3 commit 88f14bf

File tree

5 files changed

+129
-3
lines changed

5 files changed

+129
-3
lines changed

.github/chglog/CHANGELOG.tpl.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{ range .Versions }}
2+
<a name="{{ .Tag.Name }}"></a>
3+
4+
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }}
5+
6+
> {{ datetime "2006-01-02" .Tag.Date }}
7+
8+
9+
{{ range .CommitGroups -}}
10+
### {{ .Title }}
11+
12+
{{ range .Commits -}}
13+
{{if .Body }}
14+
<dl><dd><details><summary><a href="{{ $.Info.RepositoryURL }}/commit/{{ .Hash.Long }}"> {{ .Subject }}</a></summary>
15+
16+
{{ .Body }}
17+
</details></dd></dl>
18+
{{ else }}
19+
- [{{ .Subject }}]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Long }})
20+
{{ end }}
21+
{{ end }}
22+
{{ end -}}
23+
24+
{{- if .RevertCommits -}}
25+
### Reverts
26+
27+
{{ range .RevertCommits -}}
28+
* {{ .Revert.Header }}
29+
{{ end }}
30+
{{ end -}}
31+
32+
{{- if .NoteGroups -}}
33+
{{ range .NoteGroups -}}
34+
### {{ .Title }}
35+
36+
{{ range .Notes }}
37+
{{ .Body }}
38+
{{ end }}
39+
{{ end -}}
40+
{{ end -}}
41+
{{ end -}}

.github/chglog/config.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
style: github
2+
template: CHANGELOG.tpl.md
3+
info:
4+
title: CHANGELOG
5+
repository_url: https://github.com/tami5/sql.nvim
6+
options:
7+
commits:
8+
filters:
9+
Type:
10+
- sparkles
11+
- bug
12+
- zap
13+
- recycle
14+
- art
15+
- package
16+
- white_check_mark
17+
- lock
18+
- construction_worker
19+
- boom
20+
commit_groups:
21+
title_maps:
22+
sparkles: ":sparkles: Features"
23+
boom: ":boom: Breaking Changes"
24+
bug: ":bug: Bug Fixes"
25+
zap: ":zap: Performance Improvements"
26+
recycle: ":recycle: Code Refactoring"
27+
art: ":art: structure/code formating"
28+
memo: ":memo: Add or update documentation."
29+
white_check_mark: ":white_check_mark: Add/Update Test Cases"
30+
package: ":package: Dependencies"
31+
lock: ":lock: Security"
32+
construction_worker: ":construction_worker: CI Updates"
33+
header:
34+
pattern: "^:(\\w*)\\:\\s(.*)$"
35+
pattern_maps:
36+
- Type
37+
- Subject
38+
notes:
39+
keywords:
40+
- BREAKING CHANGE
41+

.github/workflows/changelog.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Generator Changelog
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
build-sources:
9+
name: Generator Changelog
10+
runs-on: ubuntu-20.04
11+
container:
12+
image: golang:1.16
13+
steps:
14+
- name: Check out a copy of the repo
15+
uses: actions/checkout@v2
16+
with: { fetch-depth: 0 }
17+
18+
- name: set todays-date
19+
run: date +%F > todays-date
20+
21+
- name: Restore cache for today's nightly.
22+
uses: actions/cache@v2
23+
with:
24+
path: build
25+
key: ${{ runner.os }}-appimage-${{ hashFiles('todays-date') }}
26+
27+
- name: Prepare
28+
run: go get github.com/git-chglog/git-chglog/cmd/git-chglog
29+
30+
- name: Generate Changelog
31+
run: |
32+
$(go env GOPATH)/bin/git-chglog --next-tag unreleased -c .github/chglog/config.yml -t .github/chglog/CHANGELOG.tpl.md -o CHANGELOG.md
33+
34+
- name: Update Changelog
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
COMMIT_MSG: |
38+
:memo: update CHANGELOG.md
39+
run: |
40+
git config user.email "actions@github"
41+
git config user.name "Actions"
42+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
43+
git add CHANGELOG.md
44+
# Only commit and push if we have changes
45+
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF})
46+

.github/workflows/docgen.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ jobs:
4747
env:
4848
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4949
COMMIT_MSG: |
50-
📝 DOC: Update doc/sql.txt
51-
skip-checks: true
50+
:memo: DOC: Update doc/sql.txt
5251
run: |
5352
git config user.email "actions@github"
5453
git config user.name "Actions"

LICENSE

-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-

0 commit comments

Comments
 (0)