Running Semantic Release Locally

— 2 minute read

Semantic Release is a great tool for managing release versions, and auto generating a changelog/ or github release notes for you software based on your commit messages.

It helps enforce consistent style across a project and forces developers to think about the code their committing and the changes that it will have on the larger application.

By default Semantic Release expects to be run on Travis-ci (or some other continuous integration tool. I often find however that for small projects (like Material Calculator) that setting this up is overkill. By default Semantic Release only does a dry run locally. Here's how to trick it into doing the real thing:

Create a .env file in your project's root with the following variables filled in:

export CI=1
export TRAVIS=true
export TRAVIS_BRANCH=master
export GH_TOKEN=
export NPM_TOKEN=

You'll also want to add this to your .gitignore as these private keys shouldn't be public.