Skip to content

Commit

Permalink
Adjust publish action to allow PyPI to be skipped on experimental rel…
Browse files Browse the repository at this point in the history
…eases
  • Loading branch information
davidorme committed Apr 4, 2024
1 parent 6cd0403 commit 22589d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/pyrealm_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions docs/source/development/release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`) -
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 22589d2

Please sign in to comment.