Rickard Lindberg | 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)

What is Rickard working on and thinking about right now?

Every month I write a newsletter about just that. You will get updates about my current projects and thoughts about programming, and also get a chance to hit reply and interact with me. Subscribe to it below.

Powered by Buttondown (My Newsletter)

Profile picture of Rickard.

I'm Rickard Lindberg from Sweden. This is my home on the web. I like programming. I like both the craft of it and also to write software that solves problems. I also like running.

Me elsewhere: GitHub, Mastodon.