Today I saw a tweet from Rob Reynolds today that Chocolatey 0.9.8.24 RC1 was released so I clicked the link which was straight to the closed issues list on GitHub.
I also noticed that many of the RCs and betas were not tagged in Git so you can’t see what was fixed each beta.
I have been working on a little utility to solve exactly this problem called GitReleaseNotes, the idea is that you install it via Chocolatey, then run GitReleaseNotes /outputFile ReleaseNotes.md /allTags
and it will connect to your issue tracker (if the issue tracker is a REMOTE in your Git repository) fetch all the closed issues since it was last run and append them into your release notes. For public GitHub repos using GitHub issues these are the same so it just works, for Jira and YouTrack you will need to specify additional command line parameters
You then can manually edit, group and do whatever you want. All your modifications will not be changed when you run GitReleaseNotes again.
The first step was to change the formatting slightly, currently GitVersion assumes all release titles will start with # <Release>
, so I changed all of the ##1.2.3 (release date)
to # 1.2.3 (release date)
.
The next step was to tell GitReleaseNotes where to start from, to do this I needed to add the commit range of the last release, the most important one is the last sha. For this I just took when the release notes was updated last, then went back in the history until I found another major release. This gave me:
Commits: [a32f1fc133...f15a8f3b52](https://github.com/chocolatey/chocolatey/compare/a32f1fc133...f15a8f3b52)
But this would work fine too
Commits: a32f1fc133...f15a8f3b52
After I had done that I just ran GitReleaseNotes /o CHANGELOG.md /allTags
and this was appended to the top of CHANGELOG.md
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
That was pretty easy, I submitted this as a pull request and Rob can just edit and next time generate the new release notes with easy. Including all the beta’s. You can view the pull request at https://github.com/chocolatey/chocolatey/pull/496 - it may not be merged, but I figured this was a good guide of how you can start using GitReleaseNotes on your own project. Feel free to post on issue on GitHub if you have issues with your project, it is still a work in progress tool after all!
You can also run GitReleaseNotes /o releasenotes.md /allTags
to generate a complete new set of release notes since the start of the project with easy. Give that a go yourself and see what the output is.
Next steps
The next function of GitReleaseNotes will be to help you publish your release. This is not done yet, but you will be able to just go on a publish build:
GitReleaseNotes /publish /version 1.2.3
which will (hopefully):
- Push a GitHub release (which will cause the tag to be created)
- Will automatically read the vNext section of your release notes and use that
- Update the version in the release notes file, and push that
Each of these steps will be able to be done individually. Then with this and GitVersion I will be able to automate MUCH more of my release process.