From bf8796e65c5667ddca6e3bba1c308ab5b7fc472e Mon Sep 17 00:00:00 2001 From: Niju Vijayakumar Date: Mon, 16 Sep 2024 11:04:05 +1000 Subject: [PATCH] feat: Update the documentation to elaborate the release process --- .release-please-manifest.json | 2 +- CONTRIBUTING.md | 57 ++++++++++++++++++++++++++++------- release-please-config.json | 2 +- 3 files changed, 48 insertions(+), 13 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 37fcefa..8c7bf66 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.0.0" + ".": "0.10.3" } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 036e468..1bcb1ba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -162,23 +162,58 @@ When you're finished with the changes, create a pull request, also known as a PR ### Release Process -#### How to create a release +#### How to Create a Release -If the latest release on GitHub is 1.0.0, and the latest pre-release is 1.1.0-rc, and if we want to create a release of 1.1.0 then the `release-please-config.json` should be updated by removing the `"versioning":"prerelease"` and setting the `"prerelease": false`. Otherwise, the GitHub Actions will not create a release and it would rather create a pre-release again. +- **Update `release-please-config.json`:** + - Remove `"versioning": "prerelease"`. + - Set `"prerelease": false`. -For this whole release process to work seamlessly, lets say the latest release on GitHub is 1.0.0, and the latest pre-release is 1.1.0-rc, and if we want to create a release of 1.1.0, then we will have to set `"bump-minor-pre-major": true,` in the `release-please-config.json` and we should change the version in the `.release-please-manifest.json` from `1.1.0-rc` to `1.0.0` before pushing changes to the remote branch. +- **Ensure correct version bump:** + - If the latest release is `1.0.0` and the latest pre-release is `1.1.0-rc`, and you want to create a release with the version `1.1.0`: + - Set `"bump-minor-pre-major": true` in `release-please-config.json`. + - Change the version in `.release-please-manifest.json` from `1.1.0-rc` to `1.0.0`. -Improper configs: -If the config is `"bump-minor-pre-major": false,` and the `.release-please-manifest.json` contains the version as `1.1.0-rc`, then the automated GH Actions will bump the major version creating a release of 2.0.0. +- **Avoid configurations that cause version/release gaps:** + - If `"bump-minor-pre-major": false` and `.release-please-manifest.json` is `1.1.0-rc`, it will create a major release `2.0.0`. + - If `"bump-minor-pre-major": true` and `.release-please-manifest.json` is `1.1.0-rc`, it will create a minor release `1.2.0`. -If the config is `"bump-minor-pre-major": true,` and the `.release-please-manifest.json` contains the version as `1.1.0-rc`, then the automated GH Actions will create a version of `1.2.0`. Either of those above improper configs will lead to a gap in the release. Hence, it's important to downgrade the version in the version file and set the `"bump-minor-pre-major": true,` if we are creating a minor release. If we are creating a major release, then perhaps use the config `"bump-minor-pre-major": false,` and then set the version in the version file to the latest release version. +- **Key points:** + - Downgrade the version in the version file for minor releases. + - Use `"bump-minor-pre-major": true` for minor releases. + - Use `"bump-minor-pre-major": false` for major releases and set the version to the latest release version. -#### How to create a pre-release +#### How to Create a Pre-Release -In order to create a pre-release, the user should just update the `release-please-config.json` in the root. They should set the `"prerelease"` to `true` and the `"versioning"` to `"prerelease"`. Otherwise, a pre-release will not be created. In this case, since the pre-release-type is set to `rc`, if the current version is `1.0.0`, and the following configs are set as `"bump-minor-pre-major": true, "bump-patch-for-minor-pre-major": false,`, then the pre-release version will be bumped to as `1.1.0-rc`. +- Update the `release-please-config.json` in the root. + - Set `"prerelease"` to `true`. + - Add the line `"versioning": "prerelease"`. +- Ensure the pre-release type is set to `rc`. + - For example, if the current version is `1.0.0` and the following configs are set: + - `"bump-minor-pre-major": true` + - `"bump-patch-for-minor-pre-major": false` + - The pre-release version will be bumped to `1.1.0-rc`. + - If the configs are set as: + - `"bump-minor-pre-major": false` + - `"bump-patch-for-minor-pre-major": false` + - The pre-release version will be `2.0.0-rc`, i.e., the major version will be bumped. -If the configs are as follows `"bump-minor-pre-major": false, "bump-patch-for-minor-pre-major": false,`, then the pre-release version will be `2.0.0-rc`, i.e., the major version will be bumped. -#### Conventional commit messages tips +### Conventional Commit Messages -- +- **Format**: `[optional scope]: ` +- **Type**: Specifies the nature of the change (e.g., `feat`, `fix`, `docs`). +- **Scope**: Optional part that specifies the section of the codebase affected. +- **Description**: A brief summary of the change. +- **Body**: Optional detailed explanation of the change. +- **Footer**: Optional additional information, such as breaking changes or issue references. + +#### Example + +```plaintext +feat(parser): add support for new data format + +Added a new parser to handle the VARIANT data format. This change includes updates to the parser module and corresponding tests. + +Closes #123 +``` +For more information on conventional commit messages, check this site: https://www.conventionalcommits.org/en/v1.0.0/ \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json index 69deeb8..af27e83 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -4,7 +4,7 @@ "changelog-path": "CHANGELOG.md", "release-type": "python", "prerelease-type": "rc", - "bump-minor-pre-major": true, + "bump-minor-pre-major": false, "bump-patch-for-minor-pre-major": false, "draft": false, "prerelease": true,