brrelease - My latest CLI

brrelease - My latest CLI

I've just created a CLI which I'm really excited by, it's called "brrelease" which is short for "branch-release". I've created this to create release tags across different branches and environments more easily. It uses semantic versioning, so it looks at your commits to determine if it's a fix, minor, or major change and generates the tag for you. But what I'm really excited about is that it creates a release branch and generates all of the files there. You can then choose whether you would like to merge it into the branch that you've created the release off or a different branch. This allows you to run releases for pretty much any workflow.

GitHub - kerren/brrelease: A CLI that assists in running releases on different branches
A CLI that assists in running releases on different branches - kerren/brrelease

So there are really two release scenarios here:

  1. Run the release on the branch you're currently on, for example, run a release on the main branch back into main.
  2. Run the release into a different branch from the branch you're currently on, for example, run a release from develop into main.

TLDR

If you're not keen to read through the README.md file on Github and the description below, I've made a YouTube video that runs through how to use this:

Same branch release

If you're looking to run a release into the same branch, you would see something like this in your git commit history:

So it branches off the branch you're on and does the following:

  1. Calculate the new version
  2. Generate the changelog based on the commits
  3. Bump the version in any (specified) files
  4. Run any scripts that have been specified by the user
  5. Merge the new branch back into main and tag that commit as v1.0.0

Different branch release

In the case of a different branch release, your commit graph would look something like this:

Here it's slightly different to the single branch release because the release branch is merged into a different branch that you specify, so the actions are as follows:

  1. Calculate the new version
  2. Generate the changelog based on the commits
  3. Bump the version in any (specified) files
  4. Run any scripts that have been specified by the user
  5. Merge the release branch into the branch that you specify, in this case it's main
  6. Tag this merge commit as v1.0.0, this is important because the tag is on main even though the release was run from develop
  7. Merge the branch main back into develop, this is done to ensure that the changelog generates correctly in future

Getting Started

Getting started is really easy, I've created a Homebrew tap to make it quick to install! If you haven't used Homebrew before, I highly recommend it 🤓

Homebrew
The Missing Package Manager for macOS (or Linux).

In order to install it, you'll just need to run:

brew install kerren/brrelease-tap/brrelease

And that's it, you're ready to use it!

brrelease release

Will generate a new release branch and tag for you and merge it into the branch that you're on. You'll want to look at flags like prerelease to see how you can generate tags for staging, uat, beta, alpha, etc environments, but that is all covered in the help on the CLI itself!

So give it a go and let me know what you think!