Blog | Projects

changelog2version

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.

How to make a release

The process for making a release of a piece of software that uses changelog2version and projects2 is this:

  1. Add a date to the current version in the changelog

  2. Commit and push that

    • This will create the release

    • This will print instructions how to tag the commit

  3. Add the next version in the changelog to start work on that version

Changelog

1.3.0

1.2.0 (2026-01-11)

1.1.0 (2026-01-10)

1.0.0 (2026-01-10)