Automate Versioning and CHANGELOG Generation
In this article, I will explain how to automate versioning and CHANGELOG generation using commit-and-tag-version

Overview
Assume we have a service/app repository. We want to automate the versioning and CHANGELOG generation. How to achieve this? In this article, I will explain how to automate versioning and CHANGELOG generation using commit-and-tag-version.
Prerequisites
commit-and-tag-version
Git Repository
How to
Installing commit-and-tag-version
npm i -g commit-and-tag-version
Preparing Configuration files
assume you already have git repository
Create configuration file
.versionrcCreate
version.jsonfile.Run first release
Test create commit
Run release
example file .versionrc and version.json
// .versionrc
{
"packageFiles": [
{
"filename": "version.json",
"type": "json"
}
],
"bumpFiles": [
{
"filename": "version.json",
"type": "json"
}
]
}
// version.json
{
"version": "1.0.0"
}
Run First Release
commit-and-tag-version --first-release
Test Create Commit
You can add a new file and then commit or create an empty commit. To create empty commit, you can follow this example command
git commit --allow-empty -m "feat: add feature A"
Run Release
commit-and-tag-version
After you run first release, you can see CHANGELOG.md file is created and version.json file is update.
If you want to read more about commit-and-tag-version, you can check the github repository.

