Automate Versioning and CHANGELOG Generation
ArticleOverview
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-versionapp- Git Repository
How to
Installing commit-and-tag-version.
npm i -g commit-and-tag-version
Assume you already have git repository.
-
Create configuration file
.versionrc// .versionrc { "packageFiles": [ { "filename": "version.json", "type": "json" } ], "bumpFiles": [ { "filename": "version.json", "type": "json" } ] } -
Create
version.jsonfile.// version.json { "version": "1.0.0" } -
Run first release
commit-and-tag-version --first-release -
Test create commit
git commit --allow-empty -m "feat: add feature A" -
Run release again
commit-and-tag-version