mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +02:00
docs(v2): publish changes after release (#3116)
This commit is contained in:
parent
0eb9c207cf
commit
3b16fb15e9
4 changed files with 27 additions and 21 deletions
|
@ -30,11 +30,16 @@ If you're publishing new v2 versions, 2FA might get in the way as the pin might
|
|||
|
||||
### 1. Git setup
|
||||
|
||||
Use the **master branch** (up to date) of the **main Docusaurus repository** (not a fork).
|
||||
From the **master branch** (up to date, main repo, not a fork), create a new branch for the release.
|
||||
|
||||
Create a new branch for the release (the branch name does not matter much):
|
||||
The branch name does not matter much, but you can use the `<your_username>/<version_to_release>` pattern.
|
||||
|
||||
```sh
|
||||
# up to date master
|
||||
git co master
|
||||
git pull
|
||||
|
||||
# create a new release branch
|
||||
git co -b <your_username>/<version_to_release>
|
||||
```
|
||||
|
||||
|
@ -42,7 +47,7 @@ git co -b <your_username>/<version_to_release>
|
|||
|
||||
Run `yarn install`
|
||||
|
||||
It should run `yarn tsc` and build the project's packages.
|
||||
It should run `yarn build:packages` and build the project's packages.
|
||||
|
||||
To make sure that all packages will work correctly when they are published, we can initialize a new D2 skeleton website, and test that it can start/built.
|
||||
|
||||
|
@ -70,6 +75,12 @@ The `tag:` label prefix is for PRs only. Other labels are not used by the change
|
|||
|
||||
Generate a GitHub auth token by going to https://github.com/settings/tokens (the only permission needed is `public_repo`). Save the token somewhere for future reference.
|
||||
|
||||
Fetch the tags from Github (lerna-changelog looks for commits since last tag by default):
|
||||
|
||||
```sh
|
||||
git fetch --tags
|
||||
```
|
||||
|
||||
Generate the changelog with:
|
||||
|
||||
```sh
|
||||
|
@ -81,8 +92,7 @@ Copy the generated contents and paste them in `CHANGELOG-2.x.md`.
|
|||
### 4. Cut a new version of the docs
|
||||
|
||||
```sh
|
||||
cd website
|
||||
yarn run docusaurus docs:version 2.0.0-alpha.41
|
||||
yarn workspace docusaurus-2-website docusaurus docs:version 2.0.0-alpha.59
|
||||
```
|
||||
|
||||
Test running the website with the new version locally.
|
||||
|
@ -91,22 +101,17 @@ Test running the website with the new version locally.
|
|||
|
||||
You should still be on your local branch `<your_username>/<version_to_release>`
|
||||
|
||||
Make a commit/push, create a pull request with the changes and get it merged.
|
||||
Make a commit/push, create a pull request with the changes.
|
||||
|
||||
Don't merge it, just check that the CI is ok with your changes.
|
||||
|
||||
If nobody is around for a review, just wait for the CI checks to complete, check the deploy preview, and merge it.
|
||||
|
||||
An example PR would be [#2287](https://github.com/facebook/docusaurus/pull/2287).
|
||||
An example PR would be [#3114](https://github.com/facebook/docusaurus/pull/3114).
|
||||
|
||||
### 6. Build and publish to npm
|
||||
|
||||
Go back to the `master` branch, from which we'll do the release
|
||||
|
||||
```
|
||||
git checkout master
|
||||
git pull
|
||||
```
|
||||
|
||||
**Note**: the `git pull` is useful to update `master` with your recently merged PR. Unfortunately if you are unlucky this might as well include other code from other merged PRs. In such case you should ensure the extra code works correctly, and include it in the changelog. (**TODO**: make the release process more robust?)
|
||||
Stay on your local branch `<your_username>/<version_to_release>`
|
||||
|
||||
As we have a monorepo structure, we use `lerna publish` to publish the new version of packages to npm in one shot.
|
||||
|
||||
|
@ -157,7 +162,7 @@ Please **double-check your permissions on these 3 packages**, otherwise you'll p
|
|||
If all accesses are available, build all the necessary packages, and then run the lerna command to release a new version:
|
||||
|
||||
```sh
|
||||
yarn tsc
|
||||
yarn build:packages
|
||||
yarn lerna publish 2.0.0-alpha.41 --dist-tag next
|
||||
```
|
||||
|
||||
|
@ -167,10 +172,12 @@ This command does a few things:
|
|||
|
||||
- Modifies the versions of all the `package.json` in the repository to be `2.0.0-alpha.41` and creates a commit
|
||||
- Creates a new Git tag `v2.0.0-alpha.41`
|
||||
- Pushes the new commit and Git tag to `master`
|
||||
- Pushes the new release commit on your branch, and add a git tag
|
||||
|
||||
You should receive many emails notifying you that a new version of the packages has been published.
|
||||
|
||||
Now that the release is done, **merge the pull request**.
|
||||
|
||||
### 7. Create a release on GitHub
|
||||
|
||||
- Go to https://github.com/facebook/docusaurus/releases/new
|
||||
|
|
|
@ -15,7 +15,7 @@ CONTAINER_NAME="verdaccio"
|
|||
docker run -d --rm --name "$CONTAINER_NAME" -p 4873:4873 -v "$PWD/admin/verdaccio.yaml":/verdaccio/conf/config.yaml verdaccio/verdaccio:4
|
||||
|
||||
# Build packages
|
||||
yarn tsc
|
||||
yarn build:packages
|
||||
|
||||
# Publish the monorepo
|
||||
npx --no-install lerna publish --yes --no-verify-access --no-git-reset --no-git-tag-version --no-push --registry "$CUSTOM_REGISTRY_URL" "$NEW_VERSION"
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
"lerna": "lerna",
|
||||
"test": "jest",
|
||||
"test:build:v2": "./admin/scripts/test-release.sh",
|
||||
"tsc": "yarn build:packages && echo '\n\nDOCUSAURUS: yarn tsc is deprecated and will be removed, use yarn build:packages instead\n\n'",
|
||||
"watch": "yarn lerna run --parallel --no-private watch",
|
||||
"clear": "yarn rimraf website/.docusaurus && rimraf -rf website/node_modules/.cache && yarn lerna exec 'yarn rimraf lib' --ignore docusaurus",
|
||||
"test:v1Migration:migrate": "rimraf website-1.x-migrated && docusaurus-migrate migrate ./website-1.x ./website-1.x-migrated && sed -i -- 's/docusaurus-1-website/docusaurus-1-website-migrated/g;' website-1.x-migrated/package.json",
|
||||
|
|
|
@ -17578,7 +17578,7 @@ react-dev-utils@^9.1.0:
|
|||
strip-ansi "5.2.0"
|
||||
text-table "0.2.0"
|
||||
|
||||
react-dom@^16.10.2, react-dom@^16.8.4:
|
||||
react-dom@^16.8.4:
|
||||
version "16.13.1"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f"
|
||||
integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag==
|
||||
|
@ -17739,7 +17739,7 @@ react-waypoint@^9.0.2:
|
|||
prop-types "^15.0.0"
|
||||
react-is "^16.6.3"
|
||||
|
||||
react@^16.10.2, react@^16.8.4:
|
||||
react@^16.8.4:
|
||||
version "16.13.1"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e"
|
||||
integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==
|
||||
|
|
Loading…
Add table
Reference in a new issue