Skip to content

Commit

Permalink
[INTERNAL] Add chglog config + npm release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomByte committed Jun 6, 2018
1 parent d9d7a7a commit c82dc4e
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Changelog
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

{{ if .Versions -}}
A list of unreleased changes can be found [here]({{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD).
{{ end -}}

{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} [`{{ .Hash.Short }}`]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Long }})
{{ end }}
{{ end -}}

{{- if .RevertCommits -}}
### Reverts
{{ range .RevertCommits -}}
- {{ .Revert.Header }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

{{- if .Versions }}
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}
34 changes: 34 additions & 0 deletions .chglog/RELEASE.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{ range .Versions }}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} [`{{ .Hash.Short }}`]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Long }})
{{ end }}
{{ end -}}

{{- if .RevertCommits -}}
### Reverts
{{ range .RevertCommits -}}
- {{ .Revert.Header }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}

{{ if .Tag.Previous }}
### All changes
<a name="{{ .Tag.Previous.Name }}...{{ .Tag.Name }}"></a>
`[{{ .Tag.Previous.Name }}...{{ .Tag.Name }}]``
{{ end }}

{{ if .Tag.Previous -}}
[{{ .Tag.Previous.Name }}...{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
31 changes: 31 additions & 0 deletions .chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/SAP/ui5-builder
options:
commits:
filters:
Type:
- FEATURE
- FIX
- PERF
- INTERNAL
commit_groups:
title_maps:
FEATURE: Features
FIX: Bug Fixes
PERF: Performance Improvements
INTERNAL: Internal Changes
header:
pattern: "^\\[(\\w*)\\]\\s(?:(\\w*)\\:\\s)?(.*)$"
pattern_maps:
- Type
- Scope
- Subject
issues:
prefix:
- "#"
notes:
keywords:
- BREAKING CHANGE
30 changes: 30 additions & 0 deletions .chglog/release-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
style: github
template: RELEASE.tpl.md
info:
repository_url: https://github.com/SAP/ui5-builder
options:
commits:
filters:
Type:
- FEATURE
- FIX
- PERF
- INTERNAL
commit_groups:
title_maps:
FEATURE: Features
FIX: Bug Fixes
PERF: Performance Improvements
INTERNAL: Internal Changes
header:
pattern: "^\\[(\\w*)\\]\\s(?:(\\w*)\\:\\s)?(.*)$"
pattern_maps:
- Type
- Scope
- Subject
issues:
prefix:
- "#"
notes:
keywords:
- BREAKING CHANGE
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
"unit-inspect": "cross-env DEBUG=*,-babel,-ava node --inspect-brk node_modules/ava/profile.js",
"coverage": "nyc npm run unit",
"jsdoc": "npm run jsdoc-generate && opn jsdocs/index.html",
"jsdoc-generate": "node_modules/.bin/jsdoc -c ./jsdoc.json ./lib/ || (echo 'Error during JSDoc generation! Check log.' && exit 1)"
"jsdoc-generate": "node_modules/.bin/jsdoc -c ./jsdoc.json ./lib/ || (echo 'Error during JSDoc generation! Check log.' && exit 1)",
"preversion": "npm test",
"version": "git-chglog --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
"postversion": "git push --follow-tags",
"release-note": "git-chglog -c .chglog/release-config.yml v$npm_package_version"
},
"ava": {
"files": [
Expand Down

0 comments on commit c82dc4e

Please sign in to comment.