The release process results in new versions of the Core and associated SDKs being published on npm. The version numbers on all SDKs must always be the same.
The release process takes place in CircleCI. CircleCI notices a new release being created and kicks off a special release workflow. The following steps take place:
-
A standard build job runs, i.e. the code is built and tested.
-
If the build is successful then a release job runs.
-
The each individual SDK is built and tested
-
Each individual SDK is published on npm.
-
A small amount of preparation needs to take place before this process kicks off. Version numbers need to be updated accordingly using the scripts provided.
Ensure the git repo is clean and there are no outstanding changes. Then check out a new branch.
git checkout -b release-x.y.z
From the root directory run the prep-release
script.
npm run release:prep
This script will interactively prompt you and ask what version you would like to update to. Select the appropriate version according to Semver.
lerna info version 2.9.0
lerna info current version 0.0.0
lerna info Checking for updated packages...
lerna info Comparing with initial commit.
lerna info Checking for prereleased packages...
? Select a new version (currently 0.0.0) Patch (0.0.1)
Changes:
- @aerogear/auth: 0.0.0 => 0.0.1
- @aerogear/core: 0.0.0 => 0.0.1
- @aerogear/cordova-plugin-aerogear-metrics: 0.0.0 => 0.0.1
? Are you sure you want to publish the above changes? Yes
Repository is ready for release.
Prepare a pre-release by adding a suffix to the end of the release tag. Examples of valid pre-release tags:
-
0.1.2-rc1
-
0.1.2-SNAPSHOT.0
-
0.1.2-alpha
If you choose to use a pre-release tag, the publish scripts later on will publish the packages using a next
tag.
This means that npm install @aerogear/<package>@next
will install your new prerelease, while npm install @aerogear/<package>
will still publish the latest regular release.
Use git status
to verify that the version numbers in the correct files have been updated.
This includes the version
attribute in the plugin.xml
files for packages that contain cordova plugins.
$ git status
On branch release-x.y.z
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: lerna.json
modified: packages/auth/package.json
modified: packages/core/package.json
modified: packages/metrics-cordova/package.json
modified: packages/metrics-cordova/plugin.xml
Commit and push these changes, then open a Pull Request to master
.
git commit -am 'release version x.y.z'
Once your changes have been merged to master, you can continue and release to npm.
Each service package currently depends on core package using peerDependency.
This dependency is not updated using automatic release scripts.
If you have made any changes in core that are breaking API peerDependency
needs to be changed manually for those packages.
To kick off a release to npm, simply Create a Release in Github. You must use the exact tag you used earlier or the release will fail.
This will kick off the automatic release process in CircleCI.
If you prepared a pre-release it is good practice to click the checkbox in Github to indicate this is a pre-release.