Skip to content

ci: build release distributions without publishing to PyPI - #50

Closed
vpanchal-supra wants to merge 1 commit into
masterfrom
ci/manual-pypi-publishing
Closed

vpanchal-supra wants to merge 1 commit into
masterfrom
ci/manual-pypi-publishing

Conversation

@vpanchal-supra

Copy link
Copy Markdown
Collaborator

We decided to publish releases to PyPI by hand. The tag workflow no longer needs a PyPI trusted publisher or a pypi environment, and neither was set up.

This PR introduces the following:

  1. Renames .github/workflows/publish.yaml to release.yaml ("Release build") and removes the publish job, so the workflow no longer has id-token: write, the pypi environment or the PyPI publish action. The build job is unchanged: on a v* tag it checks that the tag matches the version in pyproject.toml and that the commit is on master, builds the distributions and uploads them as the run's dist artifact.
  2. Rewrites RELEASING.md for the manual flow:
    • One-time setup: the Owner or Maintainer role on the supra-sdk PyPI project, an API token scoped to the project, and bypass access to the release-tags tag ruleset.
    • Release steps: download the dist artifact of the tag's run with gh run download, check it with twine check, upload it with uv publish, then create the GitHub release with both files attached.
    • Notes that local dist/ files should not be uploaded, that PyPI never accepts a file name twice, and that uploads with an API token carry no attestations.

Before releasing 0.2.0, someone who can bypass the release-tags ruleset has to push the v0.2.0 tag. The ruleset blocks v* tag creation for everyone else.

Releases are now uploaded to PyPI by hand, so the tag workflow no longer
needs a trusted publisher or a `pypi` environment. Rename publish.yaml to
release.yaml and drop the publish job. The workflow still checks the tag
against the project version and the master branch, builds the
distributions and uploads them as the run's `dist` artifact.

Rewrite RELEASING.md for the manual flow: PyPI role and project-scoped
token, downloading the run's artifact, twine check, uv publish, and the
GitHub release.
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.

1 participant