@@ -14,60 +14,90 @@ Preparing: Automatic Method
14
14
~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
15
16
16
We have developed an automated workflow for releases, that uses GitHub workflows and is triggered
17
- by opening an issue.
17
+ by `manually running <https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow >`__
18
+ the `prepare-release-pr workflow <https://github.com/pytest-dev/pytest/actions/workflows/prepare-release-pr.yml >`__
19
+ on GitHub Actions.
18
20
19
- Bug-fix releases
20
- ^^^^^^^^^^^^^^^^
21
+ The automation will decide the new version number based on the following criteria:
21
22
22
- A bug-fix release is always done from a maintenance branch, so for example to release bug-fix
23
- ``5.1.2 ``, open a new issue and add this comment to the body::
23
+ - If the "major release" input is set to "yes", release a new major release
24
+ (e.g. 7.0.0 -> 8.0.0)
25
+ - If there are any ``.feature.rst `` or ``.breaking.rst `` files in the
26
+ ``changelog `` directory, release a new minor release (e.g. 7.0.0 -> 7.1.0)
27
+ - Otherwise, release a bugfix release (e.g. 7.0.0 -> 7.0.1)
28
+ - If the "prerelease" input is set, append the string to the version number
29
+ (e.g. 7.0.0 -> 8.0.0rc1), if "major" is set, and "prerelease" is set to `rc1 `)
24
30
25
- @pytestbot please prepare release from 5.1.x
31
+ Bug-fix and minor releases
32
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
26
33
27
- Where ``5.1.x `` is the maintenance branch for the ``5.1 `` series.
34
+ Bug-fix and minor releases are always done from a maintenance branch. First,
35
+ consider double-checking the ``changelog `` directory to see if there are any
36
+ breaking changes or new features.
28
37
29
- The automated workflow will publish a PR for a branch ``release-5.1.2 ``
30
- and notify it as a comment in the issue.
38
+ For a new minor release, first create a new maintenance branch from ``main ``::
31
39
32
- Minor releases
33
- ^^^^^^^^^^^^^^
40
+ git fetch --all
41
+ git branch 7.1.x upstream/main
42
+ git push upstream 7.1.x
34
43
35
- 1. Create a new maintenance branch from `` main ``: :
44
+ Then, trigger the workflow with the following inputs :
36
45
37
- git fetch --all
38
- git branch 5.2.x upstream/main
39
- git push upstream 5.2.x
46
+ - branch: **7.1.x **
47
+ - major release: **no **
48
+ - prerelease: empty
49
+
50
+ Or via the commandline using `GitHub's cli <https://github.com/cli/cli >`__::
40
51
41
- 2. Open a new issue and add this comment to the body::
52
+ gh workflow run prepare-release-pr.yml -f branch=7.1.x -f major=no -f prerelease=
42
53
43
- @pytestbot please prepare release from 5.2.x
54
+ Where ``7.1.x `` is the maintenance branch for the ``7.1 `` series. The automated
55
+ workflow will publish a PR for a branch ``release-7.1.0 ``.
44
56
45
- The automated workflow will publish a PR for a branch ``release-5.2.0 `` and
46
- notify it as a comment in the issue.
57
+ Similarly, for a bug-fix release, use the existing maintenance branch and
58
+ trigger the workflow with e.g. ``branch: 7.0.x `` to get a new ``release-7.0.1 ``
59
+ PR.
47
60
48
- Major and release candidates
49
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61
+ Major releases
62
+ ^^^^^^^^^^^^^^
50
63
51
64
1. Create a new maintenance branch from ``main ``::
52
65
53
66
git fetch --all
54
- git branch 6 .0.x upstream/main
55
- git push upstream 6 .0.x
67
+ git branch 8 .0.x upstream/main
68
+ git push upstream 8 .0.x
56
69
57
- 2. For a ** major release **, open a new issue and add this comment in the body: :
70
+ 2. Trigger the workflow with the following inputs :
58
71
59
- @pytestbot please prepare major release from 6.0.x
72
+ - branch: **8.0.x **
73
+ - major release: **yes **
74
+ - prerelease: empty
60
75
61
- For a **release candidate**, the comment must be (TODO: `#7551 <https://github.com/pytest-dev/pytest/issues/7551>`__) ::
76
+ Or via the commandline ::
62
77
63
- @pytestbot please prepare release candidate from 6 .0.x
78
+ gh workflow run prepare- release-pr.yml -f branch=8 .0.x -f major=yes -f prerelease=
64
79
65
- The automated workflow will publish a PR for a branch ``release-6.0.0 `` and
66
- notify it as a comment in the issue.
80
+ The automated workflow will publish a PR for a branch ``release-8.0.0 ``.
67
81
68
82
At this point on, this follows the same workflow as other maintenance branches: bug-fixes are merged
69
83
into ``main `` and ported back to the maintenance branch, even for release candidates.
70
84
85
+ Release candidates
86
+ ^^^^^^^^^^^^^^^^^^
87
+
88
+ To release a release candidate, set the "prerelease" input to the version number
89
+ suffix to use. To release a ``8.0.0rc1 ``, proceed like under "major releases", but set:
90
+
91
+ - branch: 8.0.x
92
+ - major release: yes
93
+ - prerelease: **rc1 **
94
+
95
+ Or via the commandline::
96
+
97
+ gh workflow run prepare-release-pr.yml -f branch=8.0.x -f major=yes -f prerelease=rc1
98
+
99
+ The automated workflow will publish a PR for a branch ``release-8.0.0rc1 ``.
100
+
71
101
**A note about release candidates **
72
102
73
103
During release candidates we can merge small improvements into
0 commit comments