Skip to content

Commit c19f63d

Browse files
authored
Adjust releasing infra/docs (#8795)
* Adjust releasing infra/docs Follow-up for #8150, see #7507 * Add suggestions
1 parent 6573107 commit c19f63d

File tree

4 files changed

+59
-337
lines changed

4 files changed

+59
-337
lines changed

.github/workflows/release-on-comment.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

RELEASING.rst

Lines changed: 59 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,60 +14,90 @@ Preparing: Automatic Method
1414
~~~~~~~~~~~~~~~~~~~~~~~~~~~
1515

1616
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.
1820

19-
Bug-fix releases
20-
^^^^^^^^^^^^^^^^
21+
The automation will decide the new version number based on the following criteria:
2122

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`)
2430

25-
@pytestbot please prepare release from 5.1.x
31+
Bug-fix and minor releases
32+
^^^^^^^^^^^^^^^^^^^^^^^^^^
2633

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

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``::
3139

32-
Minor releases
33-
^^^^^^^^^^^^^^
40+
git fetch --all
41+
git branch 7.1.x upstream/main
42+
git push upstream 7.1.x
3443

35-
1. Create a new maintenance branch from ``main``::
44+
Then, trigger the workflow with the following inputs:
3645

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>`__::
4051

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=
4253

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

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

48-
Major and release candidates
49-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61+
Major releases
62+
^^^^^^^^^^^^^^
5063

5164
1. Create a new maintenance branch from ``main``::
5265

5366
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
5669

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:
5871

59-
@pytestbot please prepare major release from 6.0.x
72+
- branch: **8.0.x**
73+
- major release: **yes**
74+
- prerelease: empty
6075

61-
For a **release candidate**, the comment must be (TODO: `#7551 <https://github.com/pytest-dev/pytest/issues/7551>`__)::
76+
Or via the commandline::
6277

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=
6479

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

6882
At this point on, this follows the same workflow as other maintenance branches: bug-fixes are merged
6983
into ``main`` and ported back to the maintenance branch, even for release candidates.
7084

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+
71101
**A note about release candidates**
72102

73103
During release candidates we can merge small improvements into

0 commit comments

Comments
 (0)