Add PyPI publish workflow with duplicate version check #129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Backports the publish workflow from ReforgeHQ/sdk-python and adapts it for prefab-cloud-python.
This adds automated publishing to PyPI when changes are pushed to main.
Features
✅ Smart version checking - Queries PyPI API before publishing to prevent duplicate releases
✅ Trusted publishing - Uses OIDC authentication (no API tokens needed)
✅ Test before publish - Runs full test suite before building/publishing
✅ Manual trigger - Can be triggered via workflow_dispatch
✅ Conditional execution - Skips all steps if version already exists on PyPI
Workflow Triggers
mainbranchHow It Works
pyproject.tomland checks PyPIpoetry buildDifferences from sdk-python
Adapted for prefab-cloud-python:
pyproject.toml(instead ofVERSIONfile)prefab-cloud-pythonas PyPI package namePREFAB_INTEGRATION_TEST_API_KEYsecret (instead of REFORGE_*)-k 'not integration'filter (matches CI workflow)PyPI Configuration
Package:
prefab-cloud-pythonSetup Required
Before this can work, you'll need to:
Configure PyPI Trusted Publishing (in PyPI account settings):
Create GitHub environment named
release(optional, for extra protection)Testing
To test without publishing:
pyproject.tomlto a version that already exists on PyPI🤖 Generated with Claude Code