diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md deleted file mode 100755 index a092888..0000000 --- a/.chglog/CHANGELOG.tpl.md +++ /dev/null @@ -1,38 +0,0 @@ -{{ range .Versions }} - -## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }}) - -{{ range .CommitGroups -}} -### {{ .Title }} - -{{ range .Commits -}} -* {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} -{{ end }} -{{ end -}} - -{{- if .RevertCommits -}} -### Reverts - -{{ range .RevertCommits -}} -* {{ .Revert.Header }} -{{ end }} -{{ end -}} - -{{- if .MergeCommits -}} -### Pull Requests - -{{ range .MergeCommits -}} -* {{ .Header }} -{{ end }} -{{ end -}} - -{{- if .NoteGroups -}} -{{ range .NoteGroups -}} -### {{ .Title }} - -{{ range .Notes }} -{{ .Body }} -{{ end }} -{{ end -}} -{{ end -}} -{{ end -}} \ No newline at end of file diff --git a/.chglog/config.yml b/.chglog/config.yml deleted file mode 100755 index ff7879c..0000000 --- a/.chglog/config.yml +++ /dev/null @@ -1,28 +0,0 @@ -style: github -template: CHANGELOG.tpl.md -info: - title: CHANGELOG - repository_url: https://github.com/deweysasser/eks-kubeconfig-update -options: - commits: - # filters: - # Type: - # - feat - # - fix - # - perf - # - refactor - commit_groups: - # title_maps: - # feat: Features - # fix: Bug Fixes - # perf: Performance Improvements - # refactor: Code Refactoring - header: - pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$" - pattern_maps: - - Type - - Scope - - Subject - notes: - keywords: - - BREAKING CHANGE \ No newline at end of file diff --git a/Makefile b/Makefile index c05e771..fc18e1e 100644 --- a/Makefile +++ b/Makefile @@ -36,12 +36,14 @@ test: vet: go vet ./... + changelog: CHANGELOG.md -CHANGELOG.md: .chglog/config.yml - git chglog $(LAST_RELEASE) >$@ -.chglog/config.yml: go.mod - sed -i.bak -e "s|repository_url:.*|repository_url: $(REPO)|" $@ +CHANGELOG.md: LAST=$(shell git tag --sort=-version:refname | tail -n -1 | head -n 1) +CHANGELOG.md: TOP=$(shell git tag --sort=-version:refname | head -n 1) +CHANGELOG.md: + (printf "# "; git tag -l -n 50 $(TOP); echo) > $@ + git log --pretty="* %f (%h)" $(LAST).. >> $@ hooks: .git/hooks/pre-commit