We apply a semver-ish versioning scheme, using the following logic:
major
: major version number is always "1"minor
: release includes backwards incompatible changespatch
: bugfix release or backwards compatible changes/features
In all the git
shell commands below, upstream
references the repository at https://github.com/mage/mage.
- Ensure your shell is in the
master
branch:git checkout master
- Ensure you are up-to-date:
git pull upstream master
- Continue below
If you are making a minor release that is equal to the current state of the master
branch, you can release the master
-branch directly.
- Compare changes with the previous release:
git log master...1.2.3
(replace1.2.3
by the previous version tag) - Run:
npm version minor
. This will have:- Updated the version in package.
- Updated the version in package-lock.json
- Regenerated documentation
- Committed (git)
- Tagged (git)
- Run:
git push upstream master --tags
- Write up the release notes at the new tag on https://github.com/mage/mage/releases/new
- Run:
npm publish
To make a patch-release, we cherry-pick commits from master into a temporary branch that will become our release.
- Create a temporary release branch:
git checkout -b release 1.2.3
(replace1.2.3
by the previous version that you base this patch release on) - Compare changes with
master
:git log master...release --cherry-pick
(this is where we will pick commits from) - Pick all commits you wish to include:
git cherry-pick COMMITHASH
(replaceCOMMITHASH
) - Run:
npm version patch
. This will have:- Updated the version in package.json
- Updated the version in package-lock.json
- Regenerated documentation
- Committed (git)
- Tagged (git)
- Run:
git push upstream 1.2.4
(replace1.2.4
by the new version tag) - Write up the release notes at the new tag on https://github.com/mage/mage/releases/new
- Run:
npm publish
- Remove your temporary release branch:
git checkout master; git branch -d release
Now spread the news on the relevant communication channels.