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.
So there are really two release scenarios here:
- Run the release on the branch you're currently on, for example, run a release on the
main
branch back intomain
. - Run the release into a different branch from the branch you're currently on, for example, run a release from
develop
intomain
.
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:
- Calculate the new version
- Generate the changelog based on the commits
- Bump the version in any (specified) files
- Run any scripts that have been specified by the user
- Merge the new branch back into
main
and tag that commit asv1.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:
- Calculate the new version
- Generate the changelog based on the commits
- Bump the version in any (specified) files
- Run any scripts that have been specified by the user
- Merge the release branch into the branch that you specify, in this case it's
main
- Tag this merge commit as
v1.0.0
, this is important because the tag is onmain
even though the release was run fromdevelop
- Merge the branch
main
back intodevelop
, 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 🤓
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!