diff --git a/.github/workflows/pyrealm_publish.yaml b/.github/workflows/pyrealm_publish.yaml index c7f94a3e..599cbd68 100644 --- a/.github/workflows/pyrealm_publish.yaml +++ b/.github/workflows/pyrealm_publish.yaml @@ -76,13 +76,15 @@ jobs: repository-url: https://test.pypi.org/legacy/ # skip-existing: true - # The final job in the workflow is to publish to the real PyPI + # The final job in the workflow is to publish to the real PyPI as long as the release + # name does not contain the tag 'test-pypi-only' publish-PyPI: needs: publish-TestPyPI name: Publish pyrealm to PyPI runs-on: ubuntu-latest permissions: id-token: write + if: ${{ ! contains('test-pypi-only', github.event.release.name)}} steps: # Download the built package files from the job artifacts diff --git a/docs/source/development/release_process.md b/docs/source/development/release_process.md index 3fad9de5..6f7b2e5f 100644 --- a/docs/source/development/release_process.md +++ b/docs/source/development/release_process.md @@ -90,6 +90,11 @@ a target branch. The steps are: * Alternatively, you can simply type the tag name into that drop down and the tag will be created alongside the draft release. +1. You will need to choose a title for the release: basically `Release vX.Y.Z` is fine. + However, the title text also provides a mechanism for suppressing automatic trusted + publication to the main PyPI server by using `Release vX.Y.Z test-pypi-only`. See + below for details. + 1. You can create release notes automatically - this is basically a list of the commits being added since the last release - and can also set the version as a pre-release. This is different from having an explicit release version number (e.g. `X.Y.Za1`) - @@ -177,6 +182,11 @@ basic flow is: 1. As long as all the steps above succeed, the job artefacts are now published to the main PyPI site, which is also configured to trust publications from the repository. + The last step of publication to the main PyPI site can be skipped by including the + text `test-pypi-only` in the title text for the release. This allows pre-release + tests and experimentation to be tested without automatically adding them to the + official released versions. + ```{eval-rst} .. include:: ../../../.github/workflows/pyrealm_publish.yaml :code: yaml