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

Deploy cladetime to test-pypi #81

Merged
merged 3 commits into from
Jan 9, 2025
Merged

Deploy cladetime to test-pypi #81

merged 3 commits into from
Jan 9, 2025

Conversation

bsweger
Copy link
Collaborator

@bsweger bsweger commented Jan 8, 2025

Background

This PR is a starting point for getting Cladetime to PyPI.. It adds a new workflow based on part of the instructions here:
https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

  • Builds the distribution package
  • Publishes it to test-pypi

Out of scope for the PR:

  • Signing the package and uploading to GitHub releases
  • Tagging stuff
  • Publishing to PyPI proper

Implementation

  • one time step: create a Cladetime trusted publisher on test-pypi (done)

image

Reviewing and testing

Because this is a new workflow, we'll like need to merge the PR before trying the following:

  • Can we run the new publish-pypi-test.yaml workflow successfully?
  • Manual approval should be required before the publish-to-pypi-test job executes

This changeset makes a few fixes and updates to pyproject.toml as
we work towards releasing Cladetime on pypi. Mostly adds and revises
metadata, and fixes a few directives that impact the build process.
Cladetime has been successfully published to test-pypi:
https://test.pypi.org/project/cladetime/

This commit adds a workflow to automate publishing to test-pypi. Once this
is hooked up, we can focus on what deployment to the real PyPI should look like
(presumably we'd want to use a similar process to what Zhian set up for our
R packages).
- build
runs-on: ubuntu-latest
environment:
name: pypi-test
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pypi-test is an environment I created in the cladetime repo: https://github.com/reichlab/cladetime/settings/environments

  • the environment is specified as part of the trusted publisher I set up on PyPI (see screenshot on PR description)
  • the environment also specifies that the jobs using it must be manually approved before they're run (this is a requirement for publishing to PyPI)

@bsweger bsweger requested a review from zkamvar January 9, 2025 15:09
Copy link
Member

@zkamvar zkamvar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks cromulent to me. A lot of this is new to me, but it's really nice to see an actual use-case for GitHub environments and the usage of the id-token permission.

@bsweger bsweger merged commit 334001c into main Jan 9, 2025
3 checks passed
@bsweger bsweger deleted the bs/deploy-to-test-pypi/80 branch January 9, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants