ci: two-stage trusted-publishing release workflow - #61
Conversation
Tag-driven pipeline (v* tags): build sdist+wheel once, then promote the same artifacts through TestPyPI and PyPI, each behind its own GitHub Environment approval gate. Auth is OIDC trusted publishing (no stored tokens). Prerelease tags (.devN/aN/bN/rcN) stop at TestPyPI; clean vX.Y.Z tags also publish to PyPI. A guard fails the build if the tag does not match the version in pyproject.toml.
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR adds a tag-triggered GitHub Actions workflow that builds and validates Python distributions, uploads them as an artifact, and publishes them to TestPyPI and PyPI through gated OIDC-based jobs. It also configures weekly grouped Dependabot updates for GitHub Actions. ChangesPackage release pipeline
GitHub Actions update automation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GitTag
participant BuildJob
participant ArtifactStore
participant TestPyPI
participant PyPI
GitTag->>BuildJob: trigger on v* tag
BuildJob->>BuildJob: build and validate distributions
BuildJob->>ArtifactStore: upload dist artifact
ArtifactStore->>TestPyPI: provide artifact after approval
ArtifactStore->>PyPI: provide artifact for non-prerelease after approval
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 44-47: Disable pip caching in the release workflow by removing the
cache: pip setting from the actions/setup-python@v5 step, leaving Python setup
otherwise unchanged so tag-triggered builds use a clean environment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 73afcca7-e891-4bca-a078-cd52d84bd9f4
📒 Files selected for processing (1)
.github/workflows/release.yml
setup-python's pip cache is branch-scoped and writable by less-trusted runs (PRs, ci.yml on other branches). A tag-triggered publish job could restore a poisoned cache and taint the wheel uploaded to PyPI, so the privileged release workflow now builds without a shared cache. Addresses CodeRabbit / zizmor cache-poisoning finding on PR #61.
Pin every action in release.yml to a full-length commit SHA (with a trailing # vX.Y.Z comment) so a moved tag can't swap out the code a privileged, id-token-write publish job runs: actions/checkout v4.3.1 actions/setup-python v5.6.0 actions/upload-artifact v4.6.2 actions/download-artifact v4.3.0 pypa/gh-action-pypi-publish v1.14.0 Add .github/dependabot.yml (github-actions, weekly, grouped) so the pins still receive update PRs instead of silently rotting.
|
@coderabbitai review |
✅ Action performedReview finished.
|
Adds
.github/workflows/release.yml: a tag-driven release pipeline using PyPI trusted publishing (OIDC, no stored tokens).Flow
git push fork v0.2.0.dev1→ build sdist+wheel → TestPyPI (gate 1) → stops (prerelease).git push fork v0.2.0→ build → TestPyPI (gate 1) → PyPI (gate 2).The same artifacts built once are promoted through both indexes, so what lands on PyPI is byte-identical to what was smoke-tested on TestPyPI.
Safeguards
testpypi/pypi(required reviewer).pyproject.toml..devN/aN/bN/rcN) route to TestPyPI only.Notes
owner=thad0ctor repo=Gefen-X workflow=release.yml env=testpypi|pypi. Do not renamerelease.ymlor the OIDC handshake breaks.twine check, kernel sources ship in wheel+sdist, and the installed wheel JIT-compiles all CUDA kernels + runs optimizer steps on a 3090.Summary by CodeRabbit