The scripts and description assumes that you already have setup a release-management pipeline with e.g. Travis, Github and Semantic-Release. The default semantic-release branch is master
.
Let's say you are at version v1.3.0
of your package and a customer needs a bugfix in an old version v1.0.1
. The execution of npx release-tools create-release-branch --base-tag=v1.0.1 --release-branch-name=release-2017-10 --npm-token=<token>
creates a new branch release-2017-10
. From now on you can just add patch commits to release-2017-10
. semantic-release
will handle the versioning automatically and counts up step by step v1.0.2
, v1.0.3
and so on. master
just works like expected and counts up from v1.3.0
if you merge a pull request.
When you have a release cycle (e.g. 1 month), you maybe have to provide a stable package for customers every month. Your latest version on master is v1.3.0
at the end of the sprint and you want to prepare a release branch with fixes for customers.
- The versioning of
master
and the release branch shouldn't overlap. therefore, you have to bump the minor version of the master branch before creating the release branch. Executegit commit --allow-empty -m "feat: bump minor version for release management"
, create and merge a PR tomaster
.semantic-release
will create versionv1.4.0
and therefore the release-branch wont overlap for1.3.x
- Execute
npx release-tools create-release-branch --base-tag=v1.3.0 --release-branch-name=release-2017-12 --npm-token=<token>
- As in example one, this script creates a new branchrelease-2017-12
, where you can make patches forv1.3.x
and you won't have a conflict withv1.4.0
and newer versions.