Automatic Release Notes For Releases
When doing a release, it is better to have release notes with the release as it contains a piece of detailed information regarding the release such as commits attached to the release. It’s a hassle to evaluate all the commits done after the last release and trying to figure out what kind of commits were done. Hence, it’s easy if we have a way to get automatic release notes. This article contains an automatic release note configuration in Github using the Gren tool.
First, install Gren using npm.
npm install github-release-notes -g
In order to use Gren you need to create a token in GitHub
For that Go to,
Settings → Developer Settings → Personal access tokens
There you can generate a token using generate a new token and it should be copied and kept in a different place as it cannot be accessed again.
Next, the generated token can be used for the below configuration.
export GREN_GITHUB_TOKEN=your_token_here
After a specific release, a tag needs to be added with the release title. Then commits can be added. After the final commit before the release tags need to be pushed to origin.
git tag -a “w2/2018/12”
git add .
git commit -m “Final commit before release”
git push origin --tags
Finally, release can be done, by mentioning the repo name and the user name of the GitHub user as follows.
gren release --username=[username] --repo=[repo name]
When configuring Gren, it can be configured for commits or GitHub milestones.
For milestones
gren release --data-source=milestones --milestone-match="Release {{tag_name}}"
For commits
gren release --data-source=commits
For more information, refer to the Gren documentation.
Once the release is done it will display under releases in GitHub as below.
In order to publish the release note, select the tag and select the edit tag button.
From the above window, we can give a different release title or else can give the same tag for the title. Then publish the release note using Publish release button. Finally, it will be visible under GitHub releases along with the commits as follows.
Comments
Post a Comment