Today I learned

Tools to make releasing packages easier

Update (2019): This article was written on 2015. For newer alternatives, consider tools like np.

Releasing packages involves the same repetitive tasks: updating the change log, bumping versions, tagging a release, and so on. Here are a few tools to make this chore easier.

Tools I recommend

1. Bump versions via bump-cli

This utility allows you to increment versions of files through the command line. For JavaScript packages, this simply means bumping your .json files. This works with any file type with semver tags.

2. Continuously maintain the change log

There are many change log tools available, but I've found that the sanest solution is to update the log as features get implemented. Maintain an "unreleased" list on top of the change log—on release time, you'll simply need to add a date.

## v0.1.0 - unreleased

* Added feature Y
* Fixed bug Z
* ...

3. Tag and release via git-extras

Git Extras comes with the git release command, which automates creating a release commit, tags it with the right version, and pushes it.

git release "v1.0.0"

All together now

Here's how it would work for a typical npm package. These tools are language-agnostic, though—this process will also work for non-JavaScript packages.

vim HISTORY.md
bump *.json &&
npm test &&            # Run tests
npm publish &&         # Publish to npm
git release "v1.0.0"   # Publish to GitHub

You have just read Tools to make releasing packages easier, written on March 09, 2015. This is Today I Learned, a collection of random tidbits I've learned through my day-to-day web development work. I'm Rico Sta. Cruz, @rstacruz on GitHub (and Twitter!).

← More articles