You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Publishing ptf to PyPi is already fairly automated, as documented at README-publish-python-package.md.
However, the automation competes with the similar "Publish Release" automation, which creates a "Release" (https://github.com/p4lang/ptf/releases) on GitHub. They work in slightly overlapping ways, and the existing PyPI documentation fails to account for Version.txt being the single source of truth for the version number.
I'm opening this issue to discuss a new way of doing things.
Proposed PyPI automation
1. Fold PyPI publishing into the same workflow as GitHub publishing
The main benefit is that both types of publishing get triggered by the same thing. Namely, changes to Version.txt. This ensures they have the same source of truth.
2. Use OIDC-based authentication with PyPI
This is a new and nicer option for sharing trust between PyPI and our workflow.
It requires configuring PyPI as described in the linked documents. It would also be good to add a "PyPI" environment to this repo.
Once done, we can remove the PYPI_API_TOKEN secret from this repo (yay)
3. Clean up or remove the README-publish-python-package.md
ptf will be automatically published to PyPI any time Version.txt is changed. If there are no manual steps, there's no process to document separately. Of course, the automation may still be documented somewhere.
Note
With environments, it is possible to still require manual approval before publishing a release on PyPI, if that's desired.
Alternatives
Keeping PyPI publishing in a separate workflow may have some benefit, if there's any reason whatsoever to publish on a different frequency than how we publish releases on GitHub.
Background
Publishing ptf to PyPi is already fairly automated, as documented at README-publish-python-package.md.
However, the automation competes with the similar "Publish Release" automation, which creates a "Release" (https://github.com/p4lang/ptf/releases) on GitHub. They work in slightly overlapping ways, and the existing PyPI documentation fails to account for Version.txt being the single source of truth for the version number.
I'm opening this issue to discuss a new way of doing things.
Proposed PyPI automation
1. Fold PyPI publishing into the same workflow as GitHub publishing
The main benefit is that both types of publishing get triggered by the same thing. Namely, changes to Version.txt. This ensures they have the same source of truth.
2. Use OIDC-based authentication with PyPI
This is a new and nicer option for sharing trust between PyPI and our workflow.
It requires configuring PyPI as described in the linked documents. It would also be good to add a "PyPI" environment to this repo.
Once done, we can remove the PYPI_API_TOKEN secret from this repo (yay)
3. Clean up or remove the README-publish-python-package.md
ptf will be automatically published to PyPI any time Version.txt is changed. If there are no manual steps, there's no process to document separately. Of course, the automation may still be documented somewhere.
Note
With environments, it is possible to still require manual approval before publishing a release on PyPI, if that's desired.
Alternatives
Keeping PyPI publishing in a separate workflow may have some benefit, if there's any reason whatsoever to publish on a different frequency than how we publish releases on GitHub.