@@ -5,37 +5,82 @@ Our current policy for releasing is to aim for a bug-fix release every few weeks
55is to get fixes and new features out instead of trying to cram a ton of features into a release and by consequence
66taking a lot of time to make a new one.
77
8+ The git commands assume the following remotes are setup:
9+
10+ * ``origin ``: your own fork of the repository.
11+ * ``upstream ``: the ``pytest-dev/pytest `` official repository.
12+
813Preparing: Automatic Method
914~~~~~~~~~~~~~~~~~~~~~~~~~~~
1015
1116We have developed an automated workflow for releases, that uses GitHub workflows and is triggered
12- by opening an issue or issuing a comment one.
17+ by opening an issue.
18+
19+ Bug-fix releases
20+ ^^^^^^^^^^^^^^^^
21+
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::
24+
25+ @pytestbot please prepare release from 5.1.x
26+
27+ Where ``5.1.x `` is the maintenance branch for the ``5.1 `` series.
28+
29+ The automated workflow will publish a PR and notify it as a comment in the issue.
30+
31+ Minor releases
32+ ^^^^^^^^^^^^^^
33+
34+ 1. Create a new maintenance branch from ``master ``::
35+
36+ git fetch --all
37+ git branch 5.2.x upstream/master
38+ git push upstream 5.2.x
1339
14- The comment must be in the form ::
40+ 2. Open a new issue and add this comment to the body ::
1541
16- @pytestbot please prepare release from BRANCH
42+ @pytestbot please prepare release from 5.2.x
1743
18- Where `` BRANCH `` is `` master `` or one of the maintenance branches .
44+ The automated workflow will publish a PR and notify it as a comment in the issue .
1945
20- For major releases the comment must be in the form::
46+ Major and release candidates
47+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2148
22- @pytestbot please prepare major release from master
49+ 1. Create a new maintenance branch from `` master ``::
2350
24- After that, the workflow should publish a PR and notify that it has done so as a comment
25- in the original issue.
51+ git fetch --all
52+ git branch 6.0.x upstream/master
53+ git push upstream 6.0.x
54+
55+ 2. For a **major release **, open a new issue and add this comment in the body::
56+
57+ @pytestbot please prepare major release from 6.0.x
58+
59+ For a **release candidate**, the comment must be (TODO: `#7551 <https://github.com/pytest-dev/pytest/issues/7551>`__)::
60+
61+ @pytestbot please prepare release candidate from 6.0.x
62+
63+ The automated workflow will publish a PR and notify it as a comment in the issue.
64+
65+ At this point on, this follows the same workflow as other maintenance branches: bug-fixes are merged
66+ into ``master `` and ported back to the maintenance branch, even for release candidates.
67+
68+ **A note about release candidates **
69+
70+ During release candidates we can merge small improvements into
71+ the maintenance branch before releasing the final major version, however we must take care
72+ to avoid introducing big changes at this stage.
2673
2774Preparing: Manual Method
2875~~~~~~~~~~~~~~~~~~~~~~~~
2976
30- .. important ::
31-
32- pytest releases must be prepared on **Linux ** because the docs and examples expect
33- to be executed on that platform.
77+ **Important **: pytest releases must be prepared on **Linux ** because the docs and examples expect
78+ to be executed on that platform.
3479
3580To release a version ``MAJOR.MINOR.PATCH ``, follow these steps:
3681
37- #. For major and minor releases, create a new branch ``MAJOR.MINOR.x `` from the
38- latest `` master `` and push it to the `` pytest-dev/pytest `` repo .
82+ #. For major and minor releases, create a new branch ``MAJOR.MINOR.x `` from
83+ `` upstream/ master `` and push it to `` upstream `` .
3984
4085#. Create a branch ``release-MAJOR.MINOR.PATCH `` from the ``MAJOR.MINOR.x `` branch.
4186
@@ -69,7 +114,7 @@ Both automatic and manual processes described above follow the same steps from t
69114
70115 git fetch --all --prune
71116 git checkout origin/master -b cherry-pick-release
72- git cherry-pick -x -m1 origin /MAJOR.MINOR.x
117+ git cherry-pick -x -m1 upstream /MAJOR.MINOR.x
73118
74119#. Open a PR for ``cherry-pick-release `` and merge it once CI passes. No need to wait for approvals if there were no conflicts on the previous step.
75120
0 commit comments