|
2 | 2 |
|
3 | 3 | So, you want to release the `X.Y.Z` version of astroid ?
|
4 | 4 |
|
5 |
| -## Process |
| 5 | +## Releasing a major or minor version |
6 | 6 |
|
7 |
| -(Consider triggering the "release tests" workflow in GitHub Actions first.) |
| 7 | +**Before releasing a major or minor version check if there are any unreleased commits on |
| 8 | +the maintenance branch. If so, release a last patch release first. See |
| 9 | +`Releasing a patch version`.** |
8 | 10 |
|
9 |
| -1. Check if the dependencies of the package are correct |
10 |
| -2. Check the result (Do `git diff vX.Y.Z-1 ChangeLog` in particular). |
11 |
| -3. Install the release dependencies `pip3 install -r requirements_test.txt` |
12 |
| -4. Bump the version and release by using `tbump X.Y.Z --no-push`. |
13 |
| -5. Push the tag. |
14 |
| -6. Release the version on GitHub with the same name as the tag and copy and paste the |
15 |
| - appropriate changelog in the description. This trigger the pypi release. |
| 11 | +- Remove the empty changelog for the last unreleased patch version `X.Y-1.Z'`. (For |
| 12 | + example: `v2.3.5`) |
| 13 | +- Check the result of `git diff vX.Y-1.Z' ChangeLog`. (For example: |
| 14 | + `git diff v2.3.4 ChangeLog`) |
| 15 | +- Install the release dependencies: `pip3 install -r requirements_test.txt` |
| 16 | +- Bump the version and release by using `tbump X.Y.0 --no-push`. (For example: |
| 17 | + `tbump 2.4.0 --no-push`) |
| 18 | +- Check the result visually and then by triggering the "release tests" workflow in |
| 19 | + GitHub Actions first. |
| 20 | +- Push the tag. |
| 21 | +- Release the version on GitHub with the same name as the tag and copy and paste the |
| 22 | + appropriate changelog in the description. This triggers the PyPI release. |
| 23 | +- Move the `main` branch up to a dev version with `tbump`: |
16 | 24 |
|
17 |
| -## Post release |
18 |
| - |
19 |
| -### Back to a dev version |
| 25 | +```bash |
| 26 | +tbump X.Y+1.0-dev0 --no-tag --no-push # You can interrupt after the first step |
| 27 | +git commit -am "Upgrade the version to x.y+1.0-dev0 following x.y.0 release" |
| 28 | +``` |
20 | 29 |
|
21 |
| -Move back to a dev version with `tbump`: |
| 30 | +For example: |
22 | 31 |
|
23 | 32 | ```bash
|
24 |
| -tbump X.Y.Z+1-dev0 --no-tag --no-push # You can interrupt after the first step |
25 |
| -git commit -am "Upgrade the version to x.y.z+1-dev0 following x.y.z release" |
| 33 | +tbump 2.5.0-dev0 --no-tag --no-push |
| 34 | +git commit -am "Upgrade the version to 2.5.0-dev0 following 2.4.0 release" |
26 | 35 | ```
|
27 | 36 |
|
28 | 37 | Check the result and then upgrade the main branch
|
29 | 38 |
|
30 |
| -### Milestone handling |
| 39 | +- Delete the `maintenance/X.Y-1.x` branch. (For example: `maintenance/2.3.x`) |
| 40 | +- Create a `maintenance/X.Y.x` (For example: `maintenance/2.4.x` from the `v2.4.0` tag.) |
31 | 41 |
|
32 |
| -We move issue that were not done in the next milestone and block release only if it's an |
33 |
| -issue labelled as blocker. |
| 42 | +## Backporting a fix from `main` to the maintenance branch |
34 | 43 |
|
35 |
| -## Post release |
| 44 | +Whenever a commit on `main` should be released in a patch release on the current |
| 45 | +maintenance branch we cherry-pick the commit from `main`. |
36 | 46 |
|
37 |
| -### Merge tags in main for pre-commit |
| 47 | +- During the merge request on `main`, make sure that the changelog is for the patch |
| 48 | + version `X.Y-1.Z'`. (For example: `v2.3.5`) |
| 49 | +- After the PR is merged on `main` cherry-pick the commits on the `maintenance/X.Y.x` |
| 50 | + branch (For example: from `maintenance/2.4.x` cherry-pick a commit from `main`) |
| 51 | +- Release a patch version |
38 | 52 |
|
39 |
| -If the tag you just made is not part of the main branch, merge the tag `vX.Y.Z` in the |
40 |
| -main branch by doing a history only merge. It's done in order to signal that this is an |
41 |
| -official release tag, and for `pre-commit autoupdate` to works. |
| 53 | +## Releasing a patch version |
42 | 54 |
|
43 |
| -```bash |
44 |
| -git checkout main |
45 |
| -git merge --no-edit --strategy=ours vX.Y.Z |
46 |
| -git push |
47 |
| -``` |
| 55 | +We release patch versions when a crash or a bug is fixed on the main branch and has been |
| 56 | +cherry-picked on the maintenance branch. |
| 57 | + |
| 58 | +- Check the result of `git diff vX.Y-1.Z-1 ChangeLog`. (For example: |
| 59 | + `git diff v2.3.4 ChangeLog`) |
| 60 | +- Install the release dependencies: `pip3 install -r requirements_test.txt` |
| 61 | +- Bump the version and release by using `tbump X.Y-1.Z --no-push`. (For example: |
| 62 | + `tbump 2.3.5 --no-push`) |
| 63 | +- Check the result visually and then by triggering the "release tests" workflow in |
| 64 | + GitHub Actions first. |
| 65 | +- Push the tag. |
| 66 | +- Release the version on GitHub with the same name as the tag and copy and paste the |
| 67 | + appropriate changelog in the description. This triggers the PyPI release. |
| 68 | +- Merge the `maintenance/X.Y.x` branch on the main branch. The main branch should have |
| 69 | + the changelog for `X.Y-1.Z+1` (For example `v2.3.6`). This merge is required so |
| 70 | + `pre-commit autoupdate` works for pylint. |
| 71 | +- Fix version conflicts properly, or bump the version to `X.Y.0-devZ` (For example: |
| 72 | + `2.4.0-dev6`) before pushing on the main branch |
| 73 | + |
| 74 | +## Milestone handling |
| 75 | + |
| 76 | +We move issues that were not done to the next milestone and block releases only if there |
| 77 | +are any open issues labelled as `blocker`. |
0 commit comments