Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release process for versioned docs. #6

Merged
merged 3 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions docs/contribute/doc-release-process.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
description: Release process for documentation that uses a versioning system.
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved
sidebar_position: 8
---

# Documentation release process
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved

The following instructions are for documentation that uses the Docusaurus versioning system.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The following instructions are for documentation that uses the Docusaurus versioning system.
The following instructions are for documentation that uses the [Docusaurus versioning system](https://docusaurus.io/docs/next/versioning).


:::info
Currently, only the Teku documentation utilizes versioning, supporting just two versions: `stable` and `development`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Currently, only the Teku documentation utilizes versioning, supporting just two versions: `stable` and `development`.
Currently, only the Teku documentation uses versioning, supporting just two versions: `stable` and `development`.

This means previous releases must be removed as part of the release process.
:::

A new stable version of the documentation is released when a new version of the software is released.
In the following example we'll release the `23.6.3` version of the documentation (from `23.6.2`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In the following example we'll release the `23.6.3` version of the documentation (from `23.6.2`).
In the following steps, we'll release the `23.6.3` version of the documentation (from `23.6.2`) as an example.


## Steps

You'll need to create a documentation pull request with the following changes:

### 1. Create a new version of the documentation:

Create a new documentation version by running the following command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### 1. Create a new version of the documentation:
Create a new documentation version by running the following command:
### 1. Create a new version of the documentation
Create a new version by running the following command in the documentation repository:


<!--tabs-->

# Syntax

```bash
npm run docusaurus docs:version <VERSION-NUMBER>
```

# Example

```bash
npm run docusaurus docs:version 23.6.3
```

<!--/tabs-->

This command:

- Copies the full `docs/` directory into a new `version-<VERSION-NUMBER>` directory in the `versioned_docs` directory.
- Creates a new `versioned_sidebars/version-<VERSION-NUMBER>-sidebars.json` file
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved
- Appends the new version number to the `versions.json` file.

### 2. Update the `docusaurus.config.js` file

In `docusaurus.config.js`, under `presets` > `classic` > `docs`:

- Update the `lastVersion` to the new version number.
- Under `versions`, update the current stable version to the new version
bgravenorst marked this conversation as resolved.
Show resolved Hide resolved

For example, when releasing version `23.6.3` (from `23.6.2`), update the following section in the `docusaurus.config.js`
file by updating the version number:

```javascript
presets: [
[
"classic",
{
docs: {
sidebarPath: require.resolve("./sidebars.js"),
// Set a base path separate from default /docs
editUrl: "https://github.com/ConsenSys/doc.teku/tree/master/",
routeBasePath: "/",
path: "./docs",
includeCurrentVersion: true,
// highlight-next-line
lastVersion: "23.6.3",
versions: {
//defaults to the ./docs folder
// using 'development' instead of 'next' as path
current: {
label: "development",
path: "development",
},
//the last stable release in the versioned_docs/version-stable
// highlight-start
"23.6.3": {
label: "stable (23.6.3)",
},
// highlight-end
},
...
],

```

### 3. Update the `versions.json` file

Delete the previous version from the `versions.json` file:

Before:

```json
[
"23.6.3",
"23.6.2"
]
```

After:

```json
[
"23.6.3"
]
```

### 4. Delete the previous doc versions

Lastly, we'll cleanup the documentation directory by deleting the previous stable docs. For this example it means:

1. In the `versioned_docs` directory, delete the `version-23.6.2` folder
Copy link
Contributor

@alexandratran alexandratran Jul 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Lastly, we'll cleanup the documentation directory by deleting the previous stable docs. For this example it means:
1. In the `versioned_docs` directory, delete the `version-23.6.2` folder
Lastly, clean up the documentation directory by deleting the previous stable docs. For this example it means:
1. In the `versioned_docs` directory, delete the `version-23.6.2` folder.

2. In the `versioned_sidebars` directory, delete the `version-23.6.2-sidebars.json` file.

Create your pull request. You can perform a final check using the Preview link that gets created for your PR.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Create your pull request. You can perform a final check using the Preview link that gets created for your PR.
Create your pull request. You can perform a final check using the preview link generated for your PR.

Loading