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..a260fa4b47 100644 --- a/website/docs/introduction.md +++ b/website/docs/introduction.md @@ -13,6 +13,8 @@ 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 new file mode 100644 index 0000000000..3d5f0841ec --- /dev/null +++ b/website/docs/releaseProcess.md @@ -0,0 +1,40 @@ +--- +title: Release process +--- + +# Release process + +## 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. + +``` +GITHUB_TOKEN= +``` + +Once setup, 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. + +Clicking "Approved" to approve the release, and closing it, will trigger the [Part 3](#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 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 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. 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', ], }, {