Before releasing a new version of packages to the NPM and GitHub, Set all the environment variables necessary for the testing and release scripts. The required variables are
- APM_SERVER_URL
- GITHUB_TOKEN
$ GITHUB_TOKEN=<token> APM_SERVER_URL=<server-url> npm run release
To publish all the packages run npm run release with the required environment variables. It will run lerna publish(we use --independent) so it will prompt the version number for every package.
- Automatically determining a semantic version bump (based on the types of commits landed)
- Creating annotated Git tags for all the packages that has changed since last release
- Generating
CHANGELOG.mdusing conventional commit messages. - Publishing the packages via
npm publish
Note: To override the semantic version bump, use npm run release -- (minor|patch|major)
To publish a single package, run npm run release-package -- @elastic/apm-rum which uses lerna publish under the hood to publish single package to NPM
Use npm run github-release in the root directory, the script takes care packaging and creating a release for @elastic/apm-rum in GitHub with the previous annonated tag.
Note: Make sure you pass the GITHUB_TOKEN (with push access) in your environment variable while releasing
Before releasing, be sure to update the following documentation:
- Update
CHANGELOG.asciidocto add release notes for the new version. Headings should follow this format:==== x.x.x (yyyy-MM-dd). - For Major and minor releases: Add a new row to the EOL table in
docs/upgrading.asciidoc. The EOL date is the release date plus 18 months.
The release process is also automated in the way any specific commit from the master branch can be potentially released, for such it's required the below steps:
- Login to apm-ci.elastic.co
- Go to the master pipeline.
- Click on
Build with parametersand choose thereleasecheckbox. - Wait for an email to confirm the release is ready to be approved, it might take roughly 30 minutes.
- Confirm if the list of changes are the ones that are expected.
- Approve or abort.
- Then you can go to the https://registry.npmjs.org and GitHub repo to validate that the bundles and release notes have been published.