Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

382 gradle changelog automation #512

Merged

Conversation

TheRealAgentK
Copy link
Collaborator

@TheRealAgentK TheRealAgentK commented Dec 31, 2017

This is the integration of an additional solution for creating the changelog.

In general it requires the installation of https://github.com/skywinder/github-changelog-generator as a ruby gem on ones local machine.

The generator ends up as a binary on your system that can be called via a shell. There's not gradle task for it. The code in this pull request provides a task documentation/githubChangelogGenerator that relies on two bash scripts that have been added to the repo.

The first one, getLatestTag.sh retrieves the most current tag from the repo. This then gets passed in as the "since"-parameter into writeChangelog.sh (which itself then calls githubChangelogGenerator).

All this currently relies on being on a Mac OS X system (or Linux with marginal changes) and some of the paths are hardcoded. I can run it fine, see the newly generated CHANGELOG.md in this branch. You can see that it has "custom" content for 1.2.0 and 1.2.2 and is currently showing all the content for all tags (... 1.2.2, 1.3.0-RC1, 1.3.0-RC2)

The idea is that from NOW onwards, whenever a new tag is added to the repo, the Gradle task is being executed. For the next tag, let's say "CFLint-1.3.0" , said tag will then be passed as "since" into the changelog tool, run the changelog with that parameter and prepend that to the existing file (leaving all the custom content untouched). Then one could write a few lines that sum up the big items/themes of a release, add to the CHANGELOG file manually, save and commit/push.

NOTE: The current changelog generator (gitChangelog) is still there, also moved to the documentation group in Gradle and renamed from gitChangelogTask to gitChangelog.

Caveeats:

  • Dependency on OSX and a hardcoded path in my setup (that I can get rid of with a bit of additional work) - but someone would need to look into the Windows side of things - not just running windows scripts from Gradle, but also how to "translate" this chain of unix pipes into Windows:

git tag -l --format="%(creatordate:iso8601)|%(refname:short)" | sort -r | head -n 1 | awk -F'|' '{print $2}'

  • Requires a Github token in writeChangelog.sh - that (and maybe the path) would need to move into a local and git-ignored settings file people have to manage and not commit for obvious reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant