Skip to content

Commit 3d85780

Browse files
zhmiaoCopilot
andcommitted
feat(phase-h): enable prod-PyPI GPU publish + bump to 0.1.4
Phase H deliverable: flip `publish-pypi-gpu` from `if: false` to the same tag-push gate as `publish-pypi-cpu` (only on non-prerelease version tags), and add the mirrored "Validate tag matches wheel version" step to enforce the PyPI immutability invariant on the GPU side. Version bump 0.1.3 -> 0.1.4 for the first production PyPI release. 0.1.3 stays as the last TestPyPI-only build (Phase F sign-off). Trusted publishers on prod PyPI already claimed for both `sparrow-engine` and `sparrow-engine-gpu` per user confirmation 2026-05-25 22:14 PT. Files: - .github/workflows/release.yml: flip GPU prod-publish gate + add tag-version validation step + update header comment block - sparrow-engine/sparrow-engine-python/pyproject.toml: 0.1.3 -> 0.1.4 - sparrow-engine/sparrow-engine-python/Cargo.toml: 0.1.3 -> 0.1.4 - sparrow-engine/Cargo.lock: regenerated via `cargo update -p sparrow-engine-python` Dry-run plan: `gh workflow run release.yml -r phase-h-pypi-prod-publish -f target=testpypi` verifies both 0.1.4 wheels land on TestPyPI before the real tag push triggers the prod publish. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 45bf0d4 commit 3d85780

4 files changed

Lines changed: 34 additions & 18 deletions

File tree

.github/workflows/release.yml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ name: Release sparrow-engine wheels
1313
# macOS x86_64 (Intel Mac) is NOT in the matrix — no ORT 1.25.1 wheel exists for that
1414
# platform AND the macos-13 GitHub-hosted runner pool has chronic 25+ min queue latency
1515
# that blocks every release. Intel-Mac users build from source per `docs/install.md`.
16-
# GPU wheel: Linux x86_64 inside nvidia/cuda:12.6.3-cudnn-devel-ubuntu24.04 container.
16+
# GPU wheel: Linux x86_64 inside Rocky 8 / glibc 2.28 container (Phase F switch from
17+
# Ubuntu 24.04 to satisfy manylinux_2_28 policy).
1718
#
18-
# GPU PyPI publish is currently gated `if: false`. Phase E (nvjpeg dlopen rewrite)
19-
# must land first to remove the `libnvjpeg.so` DT_NEEDED and verify zero codebase
20-
# + zero performance regression. Flip the gate in Phase F.
19+
# Phase H (2026-05-25): GPU prod-PyPI publish ENABLED. Phase E (nvjpeg dlopen) +
20+
# Phase F (Rocky 8 container + auditwheel hard gate + CUDA runtime preload)
21+
# made the GPU wheel manylinux_2_28-compliant and runtime-self-contained; the
22+
# v0.1.3 TestPyPI publish + dev-box E.7-E.10 manual test verified end-to-end
23+
# install + inference. Tag-version validation step (mirrored from publish-pypi-cpu)
24+
# guards the prod-PyPI immutability invariant.
2125
#
2226
# OIDC trusted-publisher prerequisites (USER action, not automatable):
2327
# - prod PyPI: claim `sparrow-engine` + `sparrow-engine-gpu` names; configure
@@ -398,17 +402,13 @@ jobs:
398402

399403
publish-pypi-gpu:
400404
name: Publish GPU wheel to PyPI
401-
# Phase F (2026-05-25): TestPyPI GPU publish ENABLED (see
402-
# publish-testpypi-gpu below); Phase E's dlopen rewrite + the Rocky 8
403-
# build container + the auditwheel hard gate in build-gpu-linux satisfy
404-
# the manylinux_2_28 policy. This prod-PyPI gate stays `if: false` until
405-
# Phase H adds:
406-
# 1. A tag-version validation step (copy the "Validate tag matches
407-
# wheel version" block from publish-pypi-cpu at the top of this
408-
# file's `steps:`).
409-
# 2. Flip THIS condition to:
410-
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-')
411-
if: false
405+
# Phase H (2026-05-25): gate flipped from `if: false` to mirror
406+
# publish-pypi-cpu (only on actual non-prerelease version tags).
407+
# Phase E (nvjpeg dlopen) + Phase F (Rocky 8 build container + auditwheel
408+
# hard gate + CUDA runtime preload) made the GPU wheel manylinux_2_28-
409+
# compliant and runtime-self-contained; v0.1.3 TestPyPI publish + dev-box
410+
# E.7-E.10 manual test verified end-to-end install + inference.
411+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-')
412412
needs:
413413
- build-gpu-linux
414414
runs-on: ubuntu-latest
@@ -427,6 +427,22 @@ jobs:
427427
- name: Show collected dist/
428428
run: ls -la dist/
429429

430+
- name: Validate tag matches wheel version (PyPI immutability guard)
431+
run: |
432+
# Strip leading 'v' from tag: refs/tags/v0.1.4 -> 0.1.4
433+
tag_version="${GITHUB_REF_NAME#v}"
434+
# Extract version from any wheel filename; abi3 wheels share one version.
435+
# Wheel filename shape: sparrow_engine_gpu-<version>-cp311-abi3-<platform>.whl
436+
wheel_version="$(ls dist/sparrow_engine_gpu-*.whl | head -1 \
437+
| sed -E 's|.*/sparrow_engine_gpu-([^-]+)-cp311-abi3-.*|\1|')"
438+
echo "Tag version: $tag_version"
439+
echo "Wheel version: $wheel_version"
440+
if [ "$tag_version" != "$wheel_version" ]; then
441+
echo "FAIL: tag ($tag_version) and wheel ($wheel_version) versions disagree."
442+
echo "Bump pyproject.toml [project].version (and Cargo.toml) before tagging."
443+
exit 1
444+
fi
445+
430446
- uses: pypa/gh-action-pypi-publish@release/v1
431447

432448
publish-testpypi-gpu:

sparrow-engine/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sparrow-engine/sparrow-engine-python/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sparrow-engine-python"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
edition = "2021"
55
description = "PyO3 bindings for sparrow-engine (CPU or GPU pipeline) — camera trap ML inference"
66

sparrow-engine/sparrow-engine-python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ build-backend = "maturin"
2626

2727
[project]
2828
name = "sparrow-engine"
29-
version = "0.1.3"
29+
version = "0.1.4"
3030
description = "Camera-trap ML inference engine — Python bindings (sparrow-engine CPU pipeline)"
3131
requires-python = ">=3.11"
3232
# Floor bumped 3.10 → 3.11 (2026-05-07): onnxruntime / onnxruntime-gpu

0 commit comments

Comments
 (0)