Skip to content

Publish to PyPI from GitHub Actions with trusted publishing - #3

Merged
benITo47 merged 2 commits into
mainfrom
pypi-workflow
Nov 18, 2026
Merged

benITo47 merged 2 commits into
mainfrom
pypi-workflow

Conversation

@benITo47

Copy link
Copy Markdown
Collaborator

How it runs

  • By hand: Actions → "Publish to PyPI" → Run workflow. It's a dry run by default; untick "dry run" to publish.
  • On pull requests: PRs that touch reverb_tts/, tests/, pyproject.toml, README.md, LICENSE or the workflow build and test the package.

Jobs

  • Build and test:
    • builds the wheel and the sdist
    • checks the metadata with twine check --strict
    • installs the built wheel with CPU torch and runs the tests against it (the tests use a small random model, so they need no weights)
  • Publish: only on a manual run that isn't a dry run.
    • Stops if the v<version> tag already exists, so nothing is published without its tag.
    • Publishes to PyPI with trusted publishing through the pypi environment, with no stored token.
    • Creates the v<version> tag on the commit the workflow ran on, and a GitHub release with generated notes and the wheel and sdist attached.

Testing

Locally:

  • the build and twine check --strict pass
  • the tests pass against the installed wheel: 37 passed

Runs by hand, as a dry run by default; pull requests that touch the package build and test it without publishing.
Builds the wheel and the sdist, checks the metadata, tests the built wheel on CPU torch, and publishes through the
pypi environment.
Reads the version from pyproject.toml, stops before publishing if the v<version> tag already exists, and after
publishing creates the tag and the release, with generated notes and the wheel and sdist attached.
@benITo47
benITo47 requested a review from IgorSwat November 17, 2026 09:37
@benITo47
benITo47 merged commit 1e07e45 into main Nov 18, 2026
2 checks passed
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