From 6d955210765de972f78b8c307df2f2387e4580ed Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 4 Nov 2021 17:07:49 +0100 Subject: [PATCH] tool: add changelog_gen.sh to automatically generate changelog --- scripts/.gitignore | 1 + scripts/changelog-template.hbs | 28 ++++++++++++++++++++++++++++ scripts/changelog_gen.sh | 15 +++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 scripts/.gitignore create mode 100644 scripts/changelog-template.hbs create mode 100755 scripts/changelog_gen.sh diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 000000000..38799b39d --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1 @@ +CHANGELOG_LAST.md diff --git a/scripts/changelog-template.hbs b/scripts/changelog-template.hbs new file mode 100644 index 000000000..7dbfad5e3 --- /dev/null +++ b/scripts/changelog-template.hbs @@ -0,0 +1,28 @@ +{{#each releases}} + ## [{{title}}]({{href}}) {{niceDate}} + + {{#commit-list commits heading='### Breaking Changes' message='BREAKING CHANGE:'}} + - :warning: {{subject}} [`{{shorthash}}`]({{href}}) + {{/commit-list}} + + {{#commit-list commits heading='### New Features' message='^feat' exclude='BREAKING CHANGE:'}} + - {{subject}} [`{{shorthash}}`]({{href}}) + {{/commit-list}} + + {{#commit-list commits heading='### Performance' message='^perf' exclude='BREAKING CHANGE:'}} + - {{subject}} [`{{shorthash}}`]({{href}}) + {{/commit-list}} + + {{#commit-list commits heading='### Fixes' message='^fix' exclude='(^fix conflict|^fix warning|BREAKING CHANGE:)'}} + - {{subject}} [`{{shorthash}}`]({{href}}) + {{/commit-list}} + + {{#commit-list commits heading='### Docs' message='^docs'}} + - {{subject}} [`{{shorthash}}`]({{href}}) + {{/commit-list}} + + {{#commit-list commits heading='### Others' exclude='(^fix|^feat|^perf|^docs)'}} + - {{subject}} [`{{shorthash}}`]({{href}}) + {{/commit-list}} + +{{/each}} diff --git a/scripts/changelog_gen.sh b/scripts/changelog_gen.sh new file mode 100755 index 000000000..1a36e6d53 --- /dev/null +++ b/scripts/changelog_gen.sh @@ -0,0 +1,15 @@ +# Generate CHANGELOG_LAST.md from changes since the last version tag. (vx.y.z-dev tags are ignored) +# CHANGELOG_LAST.md can be edited manually if required and manually added to docs/CHANGELOG.md +# +# Requirements: +# npm install -g auto-changelog +# +# Usage: +# changelog-gen +# +# Example: if the latest verision is v5.6.7 the followings can be used for bugfix, minor or major versions: +# changelog-gen v5.6.8 +# changelog-gen v5.7.0 +# changelog-gen v6.0.0 + +auto-changelog -t changelog-template.hbs -l false --latest-version $1 --unreleased-only --tag-pattern ^v[0-9]+.[0-9]+.[0-9]+$ -o CHANGELOG_LAST.md