Skip to content
This repository was archived by the owner on Mar 6, 2023. It is now read-only.

Commit a1ebee8

Browse files
authored
Merge pull request #350 from cloudalchemy/superq/git-chglog
Use git-chglog
2 parents a66dd54 + 1892fe9 commit a1ebee8

File tree

4 files changed

+684
-431
lines changed

4 files changed

+684
-431
lines changed

.chglog/CHANGELOG.tpl.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Change Log
2+
3+
{{ if .Versions -}}
4+
## [**Next release**](https://galaxy.ansible.com/cloudalchemy/prometheus)
5+
{{ if .Unreleased.CommitGroups -}}
6+
{{ range .Unreleased.CommitGroups -}}
7+
### {{ .Title }}
8+
{{ range .Commits -}}
9+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
10+
{{ end }}
11+
{{ end -}}
12+
{{ end -}}
13+
{{ end -}}
14+
{{ range .Versions }}
15+
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
16+
{{ range .CommitGroups -}}
17+
### {{ .Title }}
18+
{{ range .Commits -}}
19+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
20+
{{ end }}
21+
{{ end -}}
22+
23+
{{- if .RevertCommits -}}
24+
**Reverts:**
25+
26+
{{ range .RevertCommits -}}
27+
- {{ .Revert.Header }}
28+
{{ end }}
29+
{{ end -}}
30+
31+
{{- if .MergeCommits -}}
32+
**Merged pull requests:**
33+
34+
{{ range .MergeCommits -}}
35+
- {{ .Header }}
36+
{{ end }}
37+
{{ end -}}
38+
39+
{{- if .NoteGroups -}}
40+
{{ range .NoteGroups -}}
41+
### {{ .Title }}
42+
{{ range .Notes }}
43+
{{ .Body }}
44+
{{ end }}
45+
{{ end -}}
46+
{{ end -}}
47+
{{ end -}}
48+
49+
{{- if .Versions }}
50+
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
51+
{{ range .Versions -}}
52+
{{ if .Tag.Previous -}}
53+
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
54+
{{ end -}}
55+
{{ end -}}
56+
{{ end -}}

.chglog/config.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
style: github
3+
template: CHANGELOG.tpl.md
4+
info:
5+
title: CHANGELOG
6+
repository_url: https://github.com/cloudalchemy/ansible-prometheus
7+
options:
8+
tag_filter_pattern: '^[0-9]'
9+
commits:
10+
# filters:
11+
# Type:
12+
# - feat
13+
# - fix
14+
# - perf
15+
# - refactor
16+
commit_groups:
17+
# title_maps:
18+
# feat: Features
19+
# fix: Bug Fixes
20+
# perf: Performance Improvements
21+
# refactor: Code Refactoring
22+
header:
23+
pattern: "^(\\w*)\\:\\s(.*)$"
24+
pattern_maps:
25+
- Type
26+
- Subject
27+
merges:
28+
pattern: "(#\\w+)"
29+
pattern_maps:
30+
- Source
31+
notes:
32+
keywords:
33+
- BREAKING CHANGE

.circleci/config.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,11 @@ jobs:
6060
fi
6161
- run: |
6262
docker run -it --rm \
63-
-v "$(pwd):/role" \
64-
-w "/role" \
65-
ferrarimarco/github-changelog-generator:1.15.2 \
66-
--user "${CIRCLE_PROJECT_USERNAME}" \
67-
--project "${CIRCLE_PROJECT_REPONAME}" \
68-
--token "${GH_TOKEN}" \
69-
--release-url "https://galaxy.ansible.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME#ansible-}" \
70-
--unreleased-label "**Next release**" --no-compare-link \
71-
--future-release "${NEW_TAG}"
63+
-v "$(pwd):/workdir" \
64+
-w "/workdir" \
65+
quay.io/git-chglog/git-chglog \
66+
--output CHANGELOG.md \
67+
--next-tag "${NEW_TAG}"
7268
- run: git add CHANGELOG.md
7369
- run: git commit -m "[ci skip] Automatic changelog update"
7470
- run: git push "https://${GH_TOKEN}:@${GIT_URL}" || circleci-agent step halt
@@ -77,9 +73,9 @@ jobs:
7773
-t ${GH_TOKEN} \
7874
-u ${CIRCLE_PROJECT_USERNAME} \
7975
-r ${CIRCLE_PROJECT_REPONAME} \
80-
-n ${GIT_TAG} \
76+
-n ${NEW_TAG} \
8177
-b "$(sed -n -e '/## \[0.22.0\]/,/## \[/ p' CHANGELOG.md | sed -e '$ d')" \
82-
${GIT_TAG}
78+
${NEW_TAG}
8379
galaxy:
8480
executor: python
8581
steps:

0 commit comments

Comments
 (0)