# Versioning all projects
We use commitizen (opens new window), husky (opens new window) and standard-version (opens new window) to standardize and automatically generate tags.
commitizen help us to standardize and enforce valid commit messages. By default, it uses AngularJS's commit message convention (opens new window) also known as conventional-changelog (opens new window).
husky allow us to install git hooks. Git hooks are scripts that Git executes before or after events such as: commit, push, and receive. We use them to lint the code before commit and to call commitizen when we call git commit.
standard-version generates a changelog based on your commits, creates a new commit including the package.json and CONGELOG files updated with the new version and release notes. Also creates a new tag with the new version number.
# Bloopers
Check if you are authenticated on npm:
npm whoami --registry=https://npm.pkg.github.com
If not, do it:
npm login --registry=https://npm.pkg.github.com
Then, go to the master branch
git checkout master
And run:
yarn release
IT will generate a new tag for the repository and publish packages on Github Packages Registry.
# Chomp & Kamek
Go to master branch and pull the code:
git checkout master
git pull
Create a new branch (with the name you want):
git checkout -b new-version
Generate the changelog and tag:
yarn release
Push it:
git push --follow-tags origin new-version
Finally, create a Pull Request to update the master branch.
To generate the release, go to the tags (opens new window) of the project and generate the release from last tag. Fill the body of the release with the notes generated in the changelog.
# Yoshi & Princess & Nabbit
To open release, go to root directory in desired application and run the following command using the format "currentYear.currentWeek":
./resources/tools/release-sh open-release 20.42
This will create a new branch from development
When QA approves the release you can close it
./resources/tools/release-sh close-release 20.42
This will create a tag with the desired name and merge release branch to master branch, then it will delete release branch.
To create an hotfix, go to root directory in desired application and use current year plus week number:
./resources/tools/release-sh open-hotfix 20.42.1
This will create a new branch from master
When QA approves the hotfix you can close it
./resources/tools/release-sh close-hotfix 20.42.1
This will create a tag with the desired name and merge hotfix branch to master branch, then it will delete hotfix branch.
TIP
You don't need to checkout to any branch before using the release script. Script does everything!
# Admin
To open release, go to root directory and run the following command using the format "currentYear-currentWeek":
./resources/tools/release-sh open-release 20-42
This will create a new branch from development
When the release branch is deployed to production you can close it
./resources/tools/release-sh close-release 20-42
This will create a tag with the desired name and merge release branch to master branch, then it will delete release branch.
To create an hotfix, go to root directory and use current year plus week number:
./resources/tools/release-sh open-hotfix 20-42.1
This will create a new branch from master
When the hotfix branch is deployed to production you can close it
./resources/tools/release-sh close-hotfix 20-42.1
This will create a tag with the desired name and merge hotfix branch to master branch, then it will delete hotfix branch.
TIP
You don't need to checkout to any branch before using the release script. Script does everything!