Skip to content

Commit cd29e5d

Browse files
committed
Add dry-run paths to release workflow
Add a manual and label-triggered way of running dry-run release builds. Also, switch from custom PR gate action to a reviewed deployment for releases.
1 parent 1e8cc1c commit cd29e5d

3 files changed

Lines changed: 437 additions & 144 deletions

File tree

‎.github/RELEASING.rst‎

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,57 @@
11
Releasing asyncpg
22
=================
33

4-
When making an asyncpg release follow the below checklist.
4+
The ``Release`` workflow builds and tests the source distribution and the
5+
Linux, macOS, and Windows wheel matrix, and builds the documentation. A live
6+
release also publishes the docs, merges and tags the release PR, creates a
7+
GitHub release, and uploads the distributions to PyPI.
58

6-
1. Remove the ``.dev0`` suffix from ``__version__`` in ``asyncpg/__init__.py``.
9+
Dry-run a release
10+
-----------------
711

8-
2. Make a release commit:
12+
Use either trigger to run the same builds without publishing anything:
913

10-
.. code-block:: shell
14+
* Add the ``release-dry-run`` label to a PR targeting ``master``. The label
15+
stays in effect for later commits to that PR, including commits that do not
16+
change ``asyncpg/_version.py``. It also works for PRs from forks. Changes to
17+
other labels do not trigger a dry run.
1118

12-
$ git commit -a -m "asyncpg vX.Y.0"
19+
* On GitHub, open **Actions > Release > Run workflow**, then select a
20+
repository branch, including ``master``. Manual runs are always dry runs.
21+
GitHub shows the **Run workflow** button once this workflow is on the
22+
default branch.
1323

14-
Here, X.Y.0 is the ``__version__`` in ``asyncpg/__init__.py``.
24+
Find the ``dist`` and ``docs-preview`` downloads under **Artifacts** on the
25+
workflow run page. The wheels are built and tested by cibuildwheel. The
26+
``docs-preview`` artifact contains the built HTML documentation.
27+
Dry runs create a local documentation commit and a signed release tag on the
28+
selected commit with a disposable signing key. They log those local refs but
29+
do not push either one to GitHub.
1530

16-
3. Force push into the "releases" branch on Github:
31+
Removing ``release-dry-run`` does not start a live release. Later commits to
32+
an unlabeled version PR follow the normal release process. If a live release
33+
run has already started, adding the label does not cancel that run; cancel it
34+
separately in Actions if needed.
1735

18-
.. code-block:: shell
36+
Publish a release
37+
-----------------
1938

20-
$ git push --force origin master:releases
21-
22-
4. Wait for CI to make the release build. If there are errors,
23-
investigate, fix and repeat steps 2 through 4.
24-
25-
5. Prepare the release changelog by cleaning and categorizing the output of
26-
``.github/release_log.py``. Look at previous releases for examples
27-
of changelog formatting:
28-
29-
.. code-block:: shell
39+
1. Update ``__version__`` in ``asyncpg/_version.py`` and prepare the release
40+
changelog. ``.github/release_log.py`` can help gather changes since the
41+
previous release tag::
3042

3143
$ .github/release_log.py <previously-released-version-tag>
3244

33-
6. Make an annotated, signed git tag and use the changelog as the tag
34-
annotation:
35-
36-
.. code-block:: shell
37-
38-
$ git tag -s vX.Y.0
39-
<paste changelog>
40-
41-
7. Push the release commit and the new tag to master on Github:
42-
43-
.. code-block:: shell
44-
45-
$ git push --follow-tags
46-
47-
8. Wait for CI to publish the build to PyPI.
45+
2. Open a PR to ``master`` with the version change. Without the dry-run label,
46+
the ``Release`` workflow builds and tests the distributions and
47+
documentation. Check the build results, then have a Release Manager approve
48+
the pending ``pypi`` deployment using **Review deployments** on the
49+
workflow run.
4850

49-
9. Edit the release on Github and paste the same content you used for
50-
the tag annotation (Github treats tag annotations as plain text,
51-
rather than Markdown.)
51+
3. After deployment approval, the workflow updates ``gh-pages``, merges and
52+
tags the PR, creates the GitHub release, and uploads the distributions to
53+
PyPI. Check these outputs after it finishes, then edit the GitHub release
54+
notes as needed.
5255

53-
10. Open master for development by bumping the minor component of
54-
``__version__`` in ``asyncpg/__init__.py`` and appending the ``.dev0``
55-
suffix.
56+
4. Open ``master`` for development by updating ``asyncpg/_version.py`` to the
57+
next development version with a ``.dev0`` suffix.

0 commit comments

Comments
 (0)