Keeping a consistent changelog is not the easiest thing. I found, that turning the
CHANGELOG.md file to the trigger of creating new versions helps a lot. Here's what I've done for the RoyalZSoftware package
1/ What I wanted to achieve
I want a workflow, where I can add the changes of the current commit to the
Later any maintainer can group those changes under a specific version and release the version to:
- GitHub tags
The actual release process should be bound to the
CHANGELOG.md file. There should be no other easy way to release.
2/ The result
Ladies and gentlemen, that's what you've been waiting for. (At least that's what I am proud of)
In the first few seconds, the video shows the current repository state. Latest version is
I append the line
2023-11-14 - 0.2.3 to the
CHANGELOG.md and then I run make.
In the background make will take this written version and apply it to the
package.json. Later it will also run
git tag and
npm publish on it.
3/ The Implementation
npm run testand build with
I need to find the latest version of the
CHANGELOG.mdfile and apply it to the
- If the latest changelog version matches the current version, abort.
Furthermore, I need to tag (
git tag) the commit with the found version
gh release create $TAG --changelog-file CHANGELOG.md
The last command is
npm publishto make it visible for all users.
You can take a look at the actual repository at https://github.com/royalzsoftware/royal-data-ts.
I fell in love with
GNU Make is a great tool, It's known for
C/C++, but can be used for really anything. I have used it to create book PDFs and epubs.
make > npm run
Automating the version process and especially the process of keeping a clean changelog has been a hustle. With this tool, I just stole all of your excuses.
Subscribe to the RoyalZSoftware newsletter
I am putting my ❤️ into these posts and I would love to deliver those handwritten pieces directly to your inbox. Subscribe below, to never miss an article.