|
| 1 | +# Twilio Python SDK — Release Plan |
| 2 | + |
| 3 | +## pre-release-check.yml — Pre-release Validation |
| 4 | + |
| 5 | +**Triggers:** Manual dispatch | Cron (Monday 9AM IST) |
| 6 | + |
| 7 | +### Jobs |
| 8 | + |
| 9 | +1. **lockfile-hygiene** |
| 10 | + - Checkout |
| 11 | + - [`uv-lockfile-hygiene`](https://github.com/twilio/sdk-actions/blob/main/uv-lockfile-hygiene/action.yml) action (scan only, no clean-room install) |
| 12 | + - Fails if internal Artifactory hosts found in `requirements*.txt` |
| 13 | + |
| 14 | +2. **test** (Python 3.12 default, or full matrix 3.8–3.13) — _needs: lockfile-hygiene_ |
| 15 | + - Checkout |
| 16 | + - [Artifactory OIDC Auth](https://github.com/twilio/sdk-actions/tree/main/artifactory-oidc) (`ecosystem: python`) |
| 17 | + - Setup Python |
| 18 | + - `pip install virtualenv` + `make install test-install` |
| 19 | + - `make test-with-coverage` |
| 20 | + |
| 21 | +3. **deploy-dry-run** (Pre-release validation) — _needs: test_ |
| 22 | + - Checkout |
| 23 | + - Artifactory OIDC Auth |
| 24 | + - Setup Python 3.12 |
| 25 | + - Validate version format is semver (`X.Y.Z`) |
| 26 | + - Build sdist + wheel (`python -m build`) |
| 27 | + - Verify with `twine check dist/*` |
| 28 | + - List artifacts + print summary |
| 29 | + - **Does NOT publish** |
| 30 | + |
| 31 | +4. **notify-on-failure** (cron runs only) |
| 32 | + - Slack notification with job results |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## deploy.yml — Publish to PyPI |
| 37 | + |
| 38 | +**Trigger:** Tag push matching `v*` |
| 39 | + |
| 40 | +### How to release |
| 41 | + |
| 42 | +1. Bump `version` in `setup.py`, merge to `main` |
| 43 | +2. Tag and push: `git tag v9.0.1 && git push --tags` |
| 44 | +3. Workflow fires automatically |
| 45 | +4. Approve the `production` environment gate when prompted |
| 46 | +5. Verify: `pip install twilio==9.0.1` + check attestations on pypi.org |
| 47 | + |
| 48 | +### Jobs |
| 49 | + |
| 50 | +1. **lockfile-hygiene** |
| 51 | + - Checkout |
| 52 | + - [`uv-lockfile-hygiene`](https://github.com/twilio/sdk-actions/blob/main/uv-lockfile-hygiene/action.yml) scan (no clean-room install) |
| 53 | + |
| 54 | +2. **test** (Python 3.8–3.13 full matrix) — _needs: lockfile-hygiene_ |
| 55 | + - Checkout |
| 56 | + - [Artifactory OIDC Auth](https://github.com/twilio/sdk-actions/tree/main/artifactory-oidc) (`ecosystem: python`) |
| 57 | + - Setup Python |
| 58 | + - `pip install virtualenv` + `make install test-install` |
| 59 | + - `make test-with-coverage` |
| 60 | + |
| 61 | +3. **deploy** (Publish to PyPI) — _needs: test, requires `production` env approval_ |
| 62 | + - Checkout |
| 63 | + - Create GitHub Release (auto-generated notes) |
| 64 | + - Artifactory OIDC Auth |
| 65 | + - Setup Python 3.12 |
| 66 | + - Validate tag format (`vX.Y.Z`) + matches `setup.py` version |
| 67 | + - Build sdist + wheel (`python -m build`) |
| 68 | + - Verify with `twine check dist/*` |
| 69 | + - Publish to PyPI (OIDC trusted publishing, PEP 740 attestations) |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | +## End-to-end Release Day Flow |
| 74 | + |
| 75 | +| Step | Action | |
| 76 | +| --- | --- | |
| 77 | +| Weekly | Monday cron runs `pre-release-check.yml` — confirms infra is healthy | |
| 78 | +| 1 | [ **_Librarian_** ] PR: bump `setup.py` version, merge to `main` | |
| 79 | +| 2 | [ **_Librarian_** ] `git tag vX.Y.Z && git push --tags` | |
| 80 | +| 3 | `deploy.yml` fires automatically on tag creation, tests run | |
| 81 | +| 4 | [ **_Manual_** ] Approve `production` environment gate | |
| 82 | +| 5 | GitHub Release created, package published to PyPI | |
| 83 | +| 6 | [ **_Manual_** ] Verify: `pip install twilio==X.Y.Z` + check attestations on pypi.org | |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +## Platform Team Dependencies |
| 88 | + |
| 89 | +| Dependency | Owner | Breaks if... | |
| 90 | +| --- | --- | --- | |
| 91 | +| Artifactory OIDC provider (`github-actions`) | SSC / Platform | Repo renamed, org changed, trust not configured | |
| 92 | +| `vars.ARTIFACTORY_URL` | Repo admin | Variable not set or URL changes | |
| 93 | +| `production` GitHub environment | Repo admin | Environment doesn't exist or approvals misconfigured | |
| 94 | +| `ubuntu-x64` runner group | Enterprise admin | Repo not added to runner group, or runner pool down | |
| 95 | +| PyPI trusted publisher | PyPI org admin | Not registered, or workflow filename / environment mismatch | |
0 commit comments