Gradle Changelog Automation Plugin
Inspired by GitLab: https://about.gitlab.com/2018/07/03/solving-gitlabs-changelog-conflict-crisis/
What does this plugin do
This plugin is able to generate CHANGELOG.md
from YAML files. One YAML file represents one unreleased changelog entry. For example, a new added feature's entry would look like this:
title: My new feature
reference: GH-1
author: John Doe
type: added
Then the plugin can process the unreleased YAML entries and combine them into CHANGELOG.md
. The changelog is based on Keep a Changelog.
As an example, see this project's changelog which is automatically generated by this plugin: CHANGELOG.md.
Getting started
How to apply the plugin
Using the plugins DSL:
plugins {
id 'org.zkovari.changelog' version '0.4.0'
}
Or using legacy plugin application:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.zkovari.changelog:changelog-automation-gradle-plugin:0.4.0'
}
}
apply plugin: 'org.zkovari.changelog'
How to generate YAML entries
The plugin contains a generator script that you can fetch with the fetchChangelogScript
task:
gradle fetchChangelogScript
# result: scripts/changelog.sh
# add permission
chmod +x scripts/changelog.sh
To generate a new unreleased changelog entry (YAML), run changelog.sh
:
./scripts/changelog.sh --type added "My new feature"
As a result, a new changelog entry is generated under changelogs/unreleased
, in this case the following one:
title: My new feature
reference:
author:
type: added
See changelog.sh --help
or the detailed documentation for further information.
How to process unreleased changelog entries
If you already have unreleased YAML entries under changelogs/unreleased
, you can combine them into your CHANGELOG.md
with the task processChangelogEntries
:
gradle processChangelogEntries
As a result, your CHANGELOG.md
is updated with a new release entry. As an exmaple, see this project's changelog which is automatically generated by this plugin: CHANGELOG.md.
The task processChangelogEntries
also removes your unreleased entries from changelogs/unreleased
.
Further documentation
Please visit our detailed documentation for further information.