Skip to content

Commit

Permalink
Add configuration files for release-please and update contributing guide
Browse files Browse the repository at this point in the history
* **release-please-config.json**: Add configuration file with release type set to `python`, changelog path to `CHANGELOG.md`, and packages to include `quinn`.
* **.release-please-manifest.json**: Add manifest file with `quinn` version set to `1.0.0`.
* **.github/workflows/release-please.yml**: Add workflow file for release-please action
* **CONTRIBUTING.md**: Add a section for the "Release Process"
  • Loading branch information
nijanthanvijayakumar committed Sep 16, 2024
1 parent e669317 commit f1e7cc9
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.0"
}
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,26 @@ When you're finished with the changes, create a pull request, also known as a PR
- Don't forget to link PR to the issue if you are solving one.
- As you update your PR and apply changes, mark each conversation as resolved.
- If you run into any merge issues, checkout this [git tutorial](https://github.com/skills/resolve-merge-conflicts) to help you resolve merge conflicts and other issues.

### Release Process

#### 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.

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.

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.

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.

#### 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`.

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

-
14 changes: 14 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "python",
"prerelease-type": "rc",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"prerelease": true,
"versioning": "prerelease"
}
}
}

0 comments on commit f1e7cc9

Please sign in to comment.