This is an internal documentation. There is a good chance you’re looking for something else. See Disclaimer.

Releasing

Semantic Releases

A package version consists of three numbers MAJOR.MINOR.PATCH.

Increment as follows:

MAJOR

Will be 1 for the moment

MINOR

If new features are added

PATCH

For bug fixes

Note

The auto release will only bump the PATCH version number. Release has to be done manually to bump the version number as desired.

Release package

Warning

Before you start, make sure:

  • You checked out the master or a nice-release/* branch. A package should not be released on a feature branch.

  • You’re logged into the NPM registry with the “tocconpm” user (check with npm whoami). See Configure npm authentication below for details.

  • You have FULL_CALENDAR_LICENCE in your .env

Once the package is ready it can be released / published.

Release a single package:

yarn release-packages {package-name}

Release multiple packages at the same time:

yarn release-packages {package-name1},{package-name2}

Release all packages:

yarn release-packages --all

If you don’t want to answer the questions use --auto that questions are automatically answered.

This will run yarn setup at the beginning to make sure all local dependencies are up to date. After that, the new version can be entered or the suggest next version can be accepted. The script will then create a changelog entry which can be edited manually, bumps the version of the package and uploads the package to the npm registry. The automatically created git tag by yarn is deleted instantly to reduce conflicts. The tag will be created by a ci job on the target branch because it would be lost anyway due to the rebase action. (Stages and Jobs) Everything gets committed and pushed to a new branch with the name of the release. To merge this changes to master or nice-release branch a merge request will be created (Merge Request)

Warning

tocco-resource-scheduler packages needs a license that is not committed with the code base. This license needs to be added prior to releasing.

To check the upcoming changelog:

yarn changelog {package-name}

Release new package

A new package has to be released manually the first time. After that it will be released with the release script automatically.

Pre-Conditions

For the manual release the same pre-conditions are required as for the scripted release (see here).

Manual release

Warning

The yarn publish and npm dist-tag commands have to be executed inside the folder of the desired package.

Warning

  • The {version} should be the same as the version in the package.json file.

  • The changelog.md has to be present and added to the repository already.

# navigate to package folder (e.g. /packages/widgets/widget-utils)
cd {package-dir}

# build and push package to NPM
yarn publish --no-commit-hooks --new-version {version}

# tag published version on NPM (optional) (nice-release-tag is the npm tag for the current nice release, e.g. `nice32`)
npm dist-tag add tocco-{package-name}@{version} {nice-release-tag} --registry=https://registry.npmjs.org/

# create and push git tag for current version (needed for release script)
git tag tocco-{package-name}@{version}
git push origin tocco-{package-name}@{version}

Configure npm authentication

We use the default NPM Registry to upload the packages. All developers use the same user on npm (user “tocconpm” with email npm@tocco.ch). To setup the authentication execute following command:

npm adduser

The password can be found on in the ansible vault.