From d7721b39d79eb2db246b265556dbe9a6dd402aec Mon Sep 17 00:00:00 2001 From: Eunjae Lee Date: Tue, 8 Mar 2022 14:31:49 +0100 Subject: [PATCH 1/4] docs: add release process --- .env.example | 3 +++ website/docs/introduction.md | 1 + website/docs/releaseProcess.md | 42 ++++++++++++++++++++++++++++++++++ website/sidebars.js | 1 + 4 files changed, 47 insertions(+) create mode 100644 .env.example create mode 100644 website/docs/releaseProcess.md diff --git a/.env.example b/.env.example new file mode 100644 index 0000000000..76a3e287ef --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +# See ./website/docs/releaseProcess.md for more information. + +GITHUB_TOKEN= \ No newline at end of file diff --git a/website/docs/introduction.md b/website/docs/introduction.md index 0fa85fca6c..7c931c6a72 100644 --- a/website/docs/introduction.md +++ b/website/docs/introduction.md @@ -13,6 +13,7 @@ To contribute to the repository, make sure to take a look at our guidelines and - [Setup the repository tooling](/docs/setupRepository): to install our tooling. - [Add a new client](/docs/addNewClient): to add a new client spec to generate. - [Support a new language](/docs/addNewLanguage): to add a new supported language to the API clients. +- [Release process](/docs/releaseProcess): to see how to release API clients. CLI commands can be found at [CLI > specs commands](/docs/specsCommands) and [CLI > generation commands](/docs/generationCommands) diff --git a/website/docs/releaseProcess.md b/website/docs/releaseProcess.md new file mode 100644 index 0000000000..2ba3e92e86 --- /dev/null +++ b/website/docs/releaseProcess.md @@ -0,0 +1,42 @@ +--- +title: Release process +--- + +# Release process + +The most of the release process is automated. + +## Part 1 + +You need `GITHUB_TOKEN` in your `.env` file. You can generate one from [Personal access token](https://github.com/settings/tokens/new) with `Repo (Full control of private repositories)` scope. + +``` +GITHUB_TOKEN= +``` + +Once it's prepared, you can run + +```bash +yarn release +``` + +It will create [a release issue](https://github.com/algolia/api-clients-automation/issues/220). + +## Part 2 + +You need to review the release issue, in two parts: + +1. version changes +2. CHANGELOGs + +Any changes applied in the issue will be taken into account by the release process. + +You can click "Approved" to approve the release, and close it, which will trigger the Part 3. + +## Part 3 + +The [GitHub action release](https://github.com/algolia/api-clients-automation/blob/main/.github/workflows/process-release.yml) is triggered. It generates clients and push changes to the submodules. All the submodules will have new commits on their base branch (`next`). + +This Part 3 runs conditionally according to what has been done in Part 2. Under "Version Changes" section of the release issue, if a language is checked, this Part 3 will creates a commit like `chore: release v` in the submodule. If it is not checked, it will create a commit like `chore: update repo `. + +Each language repository should have their own release process, and should run only when the latest commit starts with `chore: release`. By doing so, we have a way to just update the repository, for example READMEs, without having to release. diff --git a/website/sidebars.js b/website/sidebars.js index f4153fa869..8f3e3ed422 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -20,6 +20,7 @@ const sidebars = { 'addNewClient', 'addNewLanguage', 'pullRequest', + 'releaseProcess', ], }, { From 5dfaf1650f831bc3802dca9f92c422bea5757972 Mon Sep 17 00:00:00 2001 From: Eunjae Lee Date: Wed, 9 Mar 2022 11:38:00 +0100 Subject: [PATCH 2/4] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément Vannicatte <20689156+shortcuts@users.noreply.github.com> --- website/docs/releaseProcess.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/releaseProcess.md b/website/docs/releaseProcess.md index 2ba3e92e86..87d285b892 100644 --- a/website/docs/releaseProcess.md +++ b/website/docs/releaseProcess.md @@ -8,13 +8,13 @@ The most of the release process is automated. ## Part 1 -You need `GITHUB_TOKEN` in your `.env` file. You can generate one from [Personal access token](https://github.com/settings/tokens/new) with `Repo (Full control of private repositories)` scope. +You need a `GITHUB_TOKEN` in your [`.env`](https://github.com/algolia/api-clients-automation/blob/main/.env.example) file at the root of the repository. You can generate one from the [personal access token page](https://github.com/settings/tokens/new) with `Repo (Full control of private repositories)` scope. ``` GITHUB_TOKEN= ``` -Once it's prepared, you can run +Once setup, you can run ```bash yarn release @@ -31,7 +31,7 @@ You need to review the release issue, in two parts: Any changes applied in the issue will be taken into account by the release process. -You can click "Approved" to approve the release, and close it, which will trigger the Part 3. +Clicking "Approved" to approve the release, and closing it, will trigger the [Part 3](#part-3). ## Part 3 From b3d7607d1a5766813143c9774c2879ea562802f5 Mon Sep 17 00:00:00 2001 From: Eunjae Lee Date: Wed, 9 Mar 2022 11:40:18 +0100 Subject: [PATCH 3/4] docs: apply feedback --- website/docs/introduction.md | 1 + website/docs/releaseProcess.md | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/website/docs/introduction.md b/website/docs/introduction.md index 7c931c6a72..a260fa4b47 100644 --- a/website/docs/introduction.md +++ b/website/docs/introduction.md @@ -13,6 +13,7 @@ To contribute to the repository, make sure to take a look at our guidelines and - [Setup the repository tooling](/docs/setupRepository): to install our tooling. - [Add a new client](/docs/addNewClient): to add a new client spec to generate. - [Support a new language](/docs/addNewLanguage): to add a new supported language to the API clients. +- [Pull-request](/docs/pullRequest): to see how to send pull-requests. - [Release process](/docs/releaseProcess): to see how to release API clients. CLI commands can be found at [CLI > specs commands](/docs/specsCommands) and [CLI > generation commands](/docs/generationCommands) diff --git a/website/docs/releaseProcess.md b/website/docs/releaseProcess.md index 87d285b892..9d13a86b25 100644 --- a/website/docs/releaseProcess.md +++ b/website/docs/releaseProcess.md @@ -4,8 +4,6 @@ title: Release process # Release process -The most of the release process is automated. - ## Part 1 You need a `GITHUB_TOKEN` in your [`.env`](https://github.com/algolia/api-clients-automation/blob/main/.env.example) file at the root of the repository. You can generate one from the [personal access token page](https://github.com/settings/tokens/new) with `Repo (Full control of private repositories)` scope. @@ -35,7 +33,7 @@ Clicking "Approved" to approve the release, and closing it, will trigger the [Pa ## Part 3 -The [GitHub action release](https://github.com/algolia/api-clients-automation/blob/main/.github/workflows/process-release.yml) is triggered. It generates clients and push changes to the submodules. All the submodules will have new commits on their base branch (`next`). +The [GitHub action release](https://github.com/algolia/api-clients-automation/blob/main/.github/workflows/process-release.yml) is triggered. It generates clients and push changes to each language repository on their `next` branch. This Part 3 runs conditionally according to what has been done in Part 2. Under "Version Changes" section of the release issue, if a language is checked, this Part 3 will creates a commit like `chore: release v` in the submodule. If it is not checked, it will create a commit like `chore: update repo `. From 7c13462cb5a684d87b46cc165a61b9fbe795742b Mon Sep 17 00:00:00 2001 From: Eunjae Lee Date: Wed, 9 Mar 2022 16:22:54 +0100 Subject: [PATCH 4/4] docs: remove submodule mention --- website/docs/releaseProcess.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/releaseProcess.md b/website/docs/releaseProcess.md index 9d13a86b25..3d5f0841ec 100644 --- a/website/docs/releaseProcess.md +++ b/website/docs/releaseProcess.md @@ -35,6 +35,6 @@ Clicking "Approved" to approve the release, and closing it, will trigger the [Pa The [GitHub action release](https://github.com/algolia/api-clients-automation/blob/main/.github/workflows/process-release.yml) is triggered. It generates clients and push changes to each language repository on their `next` branch. -This Part 3 runs conditionally according to what has been done in Part 2. Under "Version Changes" section of the release issue, if a language is checked, this Part 3 will creates a commit like `chore: release v` in the submodule. If it is not checked, it will create a commit like `chore: update repo `. +This Part 3 runs conditionally according to what has been done in Part 2. Under "Version Changes" section of the release issue, if a language is checked, this Part 3 will creates a commit like `chore: release v` in each repository. If it is not checked, it will create a commit like `chore: update repo `. Each language repository should have their own release process, and should run only when the latest commit starts with `chore: release`. By doing so, we have a way to just update the repository, for example READMEs, without having to release.