Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Publish versions

esdmr edited this page Nov 4, 2021 · 4 revisions

How to publish a version

Apply the Changesets

pnpm run changeset:version

Commit all the changes

  1. Add all the changes: git add ..
  2. Commit all the changes: git commit.

Create/Update the release branches

Major changes

The release branch should not exist. If it does, remove it before continuing.

Run git branch releases/MAJOR master where MAJOR is the new major version.

Patch or minor changes

The release branch should already exist. If not, follow the subsection above.

Run git fetch . master:releases/MAJOR where MAJOR is the current major version.

(Optional) Deleting unsupported old releases

See “How to deprecate old major versions”.

Push all the branches

git push origin --all --set-upstream

Note: This will run the CI to update the documentation. Please wait until the CI is passing before continuing.

(Optional) Creating a git tag

  • Run git tag -a v1.2.3 where 1.2.3 is the version in package.json
  • Push the tag: git push origin --tags.

(Optional) Creating a GitHub release

Using GitHub

  1. Open the repository.
  2. Press on “Releases”. If it is not visible, press on “tags” and then select “Releases”.
  3. Press on “Create / Draft a new release”.
  4. Enter the tag version v1.2.3 where 1.2.3 is the version in package.json.
  5. Copy the tag version into the release title.
  6. Copy the correct section of the CHANGELOG.md into the description.
  7. Press on “Publish release”.

Using GitHub CLI

Note: In this section, 1.2.3 is the version in package.json.

Extract the correct section from the CHANGELOG.md into CHANGELOG-v1.2.3.md and then run the following command:

gh release create v1.2.3 \
  --title v1.2.3 \
  --notes-file CHANGELOG-v1.2.3.md

Following the command, the file CHANGELOG-v1.2.3.md is no longer needed and can be deleted.

(First version only) Enabling GitHub Pages

GitHub Pages host the documentation files. However, The documentation CI only creates the gh-pages branch once there is at least one release branch.

Using GitHub

  1. Open the repository
  2. Press on “Settings”.
  3. In the sidebar, press on “Pages”.
  4. Select gh-pages from the first drop down.
  5. Select / (root) from the second drop down.
  6. Press on “Save”.

Using curl

Note: This API currently is a preview, and might change in the future.

Run the following command, where USER/REPO is the name of the repository. This might require a personal access token.

curl \
  -X POST \
  -H 'Accept: application/vnd.github.switcheroo-preview+json' \
  repos/USER/REPO/pages \
  -d '{"source":{"branch":"gh-pages","path":"/"}}'

(Optional) Publish the new version on npm

This can not be undone easily, double check if everything is correct.

pnpm publish