Skip to content

Commit 8706ca4

Browse files
authored
add maintainer publishing instructions (#1223)
2 parents e752471 + 736acd5 commit 8706ca4

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

CONTRIBUTING.rst

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,86 @@ Build the docs in the ``docs`` directory using Sphinx.
212212
Open ``_build/html/index.html`` in your browser to view the docs.
213213

214214
Read more about `Sphinx <https://www.sphinx-doc.org/en/stable/>`__.
215+
216+
217+
Publishing a Release
218+
--------------------
219+
220+
As a maintainer, once you decide it's time to publish a new release, follow these
221+
instructions.
222+
223+
1. You'll manage the release through a PR on GitHub. Create a branch like
224+
"release-A.B.C". For a fix release, branch off the corresponding release branch. For
225+
a feature release, branch off of main.
226+
227+
```
228+
$ git switch -c release-A.B.C A.B.x
229+
```
230+
231+
2. Review the ``CHANGES.rst`` file and ensure each code change has a corresponding
232+
entry. Only code changes need entries, not docs or non-published code and files. Use
233+
your judgement on what users would want to know.
234+
235+
3. Update the ``CHANGES.rst`` file to replace "Unreleased" with "Released YYYY-MM-DD".
236+
237+
4. Update ``__version__`` in ``__init__.py`` to remove the ".dev" suffix. Ensure that
238+
the version number matches what you think you're releasing.
239+
240+
5. Commit with a standard message:
241+
242+
```
243+
$ git commit -am 'release version A.B.C'
244+
```
245+
246+
6. Push the branch and open a PR. The title should be the same as the commit message
247+
(if there was only one commit). No need to add a description. Assign it to the
248+
corresponding vesion milestone, like "3.0.4". If there's no milestone, it's because
249+
this is a newly adapted project that isn't using our full organization scheme yet,
250+
no problem.
251+
252+
7. Don't merge the PR until the end. Observe that all workflows and checks pass for the
253+
PR.
254+
255+
8. Create and push an annotated tag with a standard message. You'll see the new
256+
"build" workflow status get added to the PR checks.
257+
258+
```
259+
$ git tag -am 'release version A.B.C' A.B.C
260+
$ git push origin A.B.C
261+
```
262+
263+
9. Wait for the "build", "provenance", and "create-release" workflows to succeed. Go
264+
into the created draft release and check that the expected files (with the correct
265+
version numbers) are part of it. Add a quick message about the release, such as
266+
"This is a fix release for the 3.0.x release branch." along with a link to the
267+
changelog section and closed milestone. See an existing release in Flask for an
268+
example. Save the draft (don't publish it yet, it's not on PyPI yet.)
269+
270+
10. The "publish-pypi" workflow will have a yellow paused icon. A maintainer with
271+
publish permissions must approve it. Once they do, the release files will be
272+
uploaded to PyPI. If you don't have publish permission yet, ping the maintainers
273+
channel.
274+
275+
11. After seeing that the "publish-pypi" workflow succeeds, merge the PR. Then publish
276+
the draft release, and close the milestone.
277+
278+
12. If this was a fix release, merge it into main now that the PR is merged.
279+
280+
```
281+
$ git switch A.B.x
282+
$ git pull
283+
$ git switch main
284+
$ git merge A.B.x
285+
```
286+
287+
12. If this was a feature release, make a new branch for fix releases.
288+
289+
```
290+
$ git switch main
291+
$ git pull
292+
$ git switch -c A.B.x
293+
$ git push
294+
```
295+
296+
13. If this was a feature release, ask a maintainer with docs access to update Read the
297+
Docs to use the new branch as the primary.

0 commit comments

Comments
 (0)