ci: publish python dev packages to PyPI on main pushes - #292
Conversation
Signed-off-by: kmilo <kmilo.denis.glez@yandex.com>
|
@ryjones @tock-ibm @denyeart @bestbeforetoday |
|
Tick the box to add this pull request to the merge queue (same as
|
Signed-off-by: Ry Jones <ry@linux.com>
|
@pfi79 I've added a pending secure publishing workflow. I've also added a commit to sha-pin the uses clauses.
|
@pfi79 Yes. I compared the Python workflow against the Node.js one.
The Python workflow already generates a unique PEP 440 dev version for non-release builds; the only missing piece is the publish condition, which currently requires
publish_release == 'true'(release tags only). I've aligned it with Node.js:github.ref == 'refs/heads/main' || needs.ci_checks.outputs.publish_release == 'true'Result:
main: publish the.dev<run_id>snapshot to PyPIThe artifact step now also covers manual
workflow_dispatchruns from non-main branches, mirroring Node's dry-run behavior.One operational detail before this merges:
Since this is a brand-new project name on PyPI, the first OIDC publish requires a "pending publisher" registration at pypi.org/manage/account/publishing/ — it can't be created from the repo via CI/CD for security reasons. Whoever registers it becomes the project Owner on PyPI, so it should probably be someone from the Hyperledger/LF side rather than me. Either the owner or the maintainer (if one exists) of the PyPI account or organization.
PyPI Trusted Publishing Setup Guide (For Maintainers)
Steps to Configure Trusted Publishing
Required Form Values
hyperledger-fabric-protoshyperledgerfabric-protospython-bindings.yml(exact filename in.github/workflows/)Once this is saved on PyPI, the first merged PR or release push will authenticate seamlessly via GitHub OIDC without needing long-lived PyPI API tokens.