Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/publish_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,18 @@ jobs:
TAG: ${{ github.ref_name }}
run: |
VERSION="${TAG#v}"
pip install --retries 10 "genkit==${VERSION}"
# PyPI's simple index lags the upload by up to a few minutes, and
# pip's --retries only covers network errors, not "no matching
# distribution". Poll until the new version resolves.
for attempt in $(seq 1 20); do
if pip install --no-cache-dir "genkit==${VERSION}"; then
break
fi
if [ "$attempt" -eq 20 ]; then
echo "genkit==${VERSION} still not installable after 10 minutes" >&2
exit 1
fi
echo "genkit==${VERSION} not on the index yet, retrying in 30s ($attempt/20)"
sleep 30
done
python -c "from genkit import Genkit; Genkit(); print('ok')"
4 changes: 2 additions & 2 deletions bin/create_release
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,5 @@ fi
echo " ✓ Published https://github.com/$REPO/releases/tag/$TAG"

echo ""
echo "Next: approve the PyPI publish at https://github.com/$REPO/actions/workflows/publish_python.yml"
echo "Then verify with: pip index versions genkit"
echo "The tag push started the PyPI publish: https://github.com/$REPO/actions/workflows/publish_python.yml"
echo "Verify with: pip index versions genkit"
7 changes: 3 additions & 4 deletions docs/release_playbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ There is one path. `create_release` refuses to run unless every step below was f
1. `bin/bump_version X.Y.Z` on a branch from main. It bumps every `pyproject.toml` and `uv.lock`.
2. Open a PR to main titled `chore: release vX.Y.Z` or `chore(py): release Python SDK vX.Y.Z`. Its description is the release notes, published word for word.
3. Get it approved and merged.
4. `bin/create_release X.Y.Z <PR_NUMBER> --dry-run`, then without `--dry-run`.
5. Approve the publish at <https://github.com/genkit-ai/genkit-python/actions/workflows/publish_python.yml>. The tag push already started it; don't run it by hand.
6. `pip index versions genkit` shows X.Y.Z.
4. `bin/create_release X.Y.Z <PR_NUMBER> --dry-run`, then without `--dry-run`. The tag push starts the [publish workflow](https://github.com/genkit-ai/genkit-python/actions/workflows/publish_python.yml), which uploads to PyPI with no approval step. Don't run it by hand.
5. `pip index versions genkit` shows X.Y.Z.

`create_release` runs every check before it changes anything and prints a fix for each failure:

Expand Down Expand Up @@ -72,7 +71,7 @@ Resolvers skip yanked versions unless pinned with `==`, so existing exact pins k
**Two jobs:** publish → verify

- **publish**: Builds all packages with `uv build`, then uploads to PyPI via `pypa/gh-action-pypi-publish`. All-or-nothing — if any build fails, the job fails.
- **verify**: `pip install genkit==<version>` + import test.
- **verify**: `pip install genkit==<version>` + import test. It polls for up to 10 minutes, since PyPI's index can lag the upload.

## Auth

Expand Down
Loading