Skip to content

Auto-publish to PyPI on GitHub release (Trusted Publisher)#179

Merged
ChrisRackauckas merged 1 commit into
masterfrom
add-pypi-trusted-publisher
May 14, 2026
Merged

Auto-publish to PyPI on GitHub release (Trusted Publisher)#179
ChrisRackauckas merged 1 commit into
masterfrom
add-pypi-trusted-publisher

Conversation

@ChrisRackauckas
Copy link
Copy Markdown
Member

Summary

  • Adds .github/workflows/release.yml that fires on release: published
  • Builds sdist + wheel with python -m build
  • Uploads via pypa/gh-action-pypi-publish using OIDC — no PyPI token stored in repo secrets

After this lands, the release flow is: bump version → tag → gh release create → workflow uploads to PyPI automatically.

One-time PyPI setup required before this works

On https://pypi.org/manage/project/diffeqpy/settings/publishing/ add a Trusted Publisher with:

  • Owner: SciML
  • Repository: diffeqpy
  • Workflow filename: release.yml
  • Environment: pypi

(The pypi environment is declared in the workflow's environment: block. Optionally create a matching GitHub Environment under repo Settings → Environments for protection rules; not required for publishing to work.)

Test plan

  • PyPI Trusted Publisher registered as above
  • After merge, cut a patch release (e.g. v2.6.1) and confirm the workflow run uploads the artifact
  • Verify https://pypi.org/project/diffeqpy/ shows the new version

🤖 Generated with Claude Code

On a published GitHub release, build sdist+wheel and upload to PyPI
via OIDC (no token required).

Requires a one-time setup on PyPI: register SciML/diffeqpy as a
Trusted Publisher for the diffeqpy project, with workflow
"release.yml" and environment "pypi".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas merged commit 06644d1 into master May 14, 2026
4 checks passed
@ChrisRackauckas ChrisRackauckas deleted the add-pypi-trusted-publisher branch May 14, 2026 11:14
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