A tool to extarct version information from a changelog.
Typical usage:
changelog2version <README.md >version.sh
With a README.md like this:
## Changelog ### 1.2.3 * Added feature Y ### 1.2.2 (2026-01-05) * Added feature X
It will generate version.sh like this:
VERSION=1.2.3
if [ "$VCS_SHORT_ID" = "" ]; then
VCS_SHORT_ID=dev
VCS_COMMITS_SINCE_1_2_2=0
else
if [ "$VCS_COMMITS_SINCE_1_2_2" = "" ]; then
echo "Could not find environment variable VCS_COMMITS_SINCE_1_2_2"
exit 1
fi
fi
FULL_VERSION=1.2.3-beta.$VCS_COMMITS_SINCE_1_2_2+$VCS_SHORT_ID
PROJECTS2_TAGS=', "tags": []'
With a README.md like this:
## Changelog ### 1.2.3 (2026-01-10) * Added feature Y ### 1.2.2 (2026-01-05) * Added feature X
It will generate version.sh like this:
VERSION=1.2.3 FULL_VERSION=1.2.3 PROJECTS2_TAGS=', "tags": ["1.2.3"]'
version.sh is typically sourced from a build script to gain access to the variables. The VCS_* environment variables are assumed to be provided by the continuous integration system.
The process for making a release of a piece of software that uses changelog2version and projects2 is this:
Add a date to the current version in the changelog
Commit and push that
This will create the release
This will print instructions how to tag the commit
Add the next version in the changelog to start work on that version
Base beta version on VCS_COMMITS_SINCE*
Can skip code blocks when searching for changelog
Generate PROJECTS2_TAGS
First version