Skip to content

Releasing a new version

Marco Vettorello edited this page Nov 16, 2022 · 1 revision

Publish a new Release

A GH Action allows you to create a new release of @elastic/charts thanks to semantic-release: the release version and change logs will be automatically generated from the commits available in master between the latest release tag and the current HEAD. This procedure will publish the new version in the NPM registry. To release: Go to Actions -> Publish release -> Run Workflow on master branch and press Run

Screenshot 2022-11-16 at 09 55 02

Publish a backport

The same GH Action used to publish a new release can be used to publish a backported PR by selecting the backported branch in the Run Workflow dropdown menu.

Screenshot 2022-11-16 at 09 57 30

How to fix/deprecate a bad release in npm

If a bad package was released (e.g. with wrong semantic versioning due to badly formatted commits) you can follow these steps:

  1. Delete the release in GH
  2. Delete the tag in GH
  3. Unpublish package version npm unpublish @elastic/[email protected]
  4. Remove the latest commit, the one auto-generated by the release
  5. Interactive rebase and reword bad commit, force push upstream

Steps 1-3 are used to remove the old version, these are required to release the same version. In this case, it was not needed but good to remove all traces of the bad version.

Notes: The unpublish command only works shortly after release, depending on the time since release and the number of package downloads. If unpublish doesn’t work just use the npm deprecate. These commands are only available to select Elastic users.