Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Use PyPI Trusted Publisher for publishing package #107

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

matthewfeickert
Copy link
Member

  • Split the build and publish steps into two separate jobs. The 'build' job builds and checks the distributions and then uploads them as a job artifact. The 'publish' job downloads the required artifact from the 'build' job and the publishes them to TestPyPI or PyPI if the typical publishing requirements are met.
  • Use the OpenID Connect (OIDC) standard to publish to PyPI and TestPyPI using PyPI's "Trusted Publisher" implementation to publish without using API tokens stored as GitHub Actions secrets. Use an optional GitHub Actions environment to further restrict publishing to selected branches ('main', 'release/', 'v') for additional security.

* Split the build and publish steps into two separate jobs. The 'build' job
  builds and checks the distributions and then uploads them as a job artifact.
  The 'publish' job downloads the required artifact from the 'build' job and
  the publishes them to TestPyPI or PyPI if the typical publishing requirements
  are met.
* Use the OpenID Connect (OIDC) standard to publish to PyPI and TestPyPI
  using PyPI's "Trusted Publisher" implementation to publish without
  using API tokens stored as GitHub Actions secrets. Use an optional
  GitHub Actions environment to further restrict publishing to selected
  branches ('main', 'release/*', 'v*') for additional security.
   - c.f. https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/
   - c.f. https://docs.pypi.org/trusted-publishers/
@matthewfeickert matthewfeickert self-assigned this Jun 20, 2023
@matthewfeickert matthewfeickert added the enhancement New feature or request label Jun 20, 2023
@matthewfeickert matthewfeickert merged commit aafdbf9 into main Jun 20, 2023
8 checks passed
@matthewfeickert matthewfeickert deleted the ci/use-trusted-publishers branch June 20, 2023 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant