Skip to content

Add PyPI publish workflow on tag push#12

Open
odesenfans wants to merge 1 commit into
mainfrom
release-pipeline
Open

Add PyPI publish workflow on tag push#12
odesenfans wants to merge 1 commit into
mainfrom
release-pipeline

Conversation

@odesenfans
Copy link
Copy Markdown
Collaborator

Summary

  • Add .github/workflows/publish.yml that triggers on any tag push, builds sdist+wheel with python -m build, and publishes to PyPI via the trusted-publisher (OIDC) flow.
  • Modeled on the publish.yml from aleph-message, adapted for this project's setuptools + setuptools_scm build (vs. hatch).
  • fetch-depth: 0 is set so setuptools_scm can derive the version from the tag.

Required setup on PyPI / GitHub before the first release

  1. PyPI trusted publisher for project aleph-p2p-client, pointing at:
    • Repository: aleph-im/p2p-service-client-python
    • Workflow: publish.yml
    • Environment: pypi
    • (If the project does not yet exist on PyPI, use the "pending" trusted publisher flow.)
  2. GitHub environment named pypi (repo Settings → Environments). Add reviewers or a tag protection rule here if desired.

Test plan

  • Confirm trusted publisher is configured on PyPI for this project + workflow + environment.
  • Confirm a pypi environment exists in repo settings.
  • Push a test tag (e.g. on a fork or to TestPyPI first) and verify the workflow builds and publishes successfully.

🤖 Generated with Claude Code

Builds sdist+wheel via python -m build and uploads via PyPI trusted
publisher (OIDC). Requires a 'pypi' environment in the repo and a
trusted-publisher configuration on PyPI pointing at this workflow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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