Skip to content

feat(release): build and publish sdist/wheels on GitHub Release - #1207

Merged
seonghobae merged 17 commits into
mainfrom
feat/publish-pypi-release-assets
Aug 24, 2026
Merged

feat(release): build and publish sdist/wheels on GitHub Release#1207
seonghobae merged 17 commits into
mainfrom
feat/publish-pypi-release-assets

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Change

Adds a release-controlled package publication path for hash-pinnable fast-mlsirm sdists and wheels, with exact-tag provenance, pinned build/publish tooling, isolated GitHub release writes, and explicit recovery semantics for the two publication sinks.

Release provenance and trigger integrity

  • release-tag.yml creates the immutable tag/GitHub Release and explicitly dispatches publish-pypi.yml from that exact tag; it does not depend on a token-created release event recursively starting another workflow.
  • verify-release checks out the exact dispatched tag with persisted credentials disabled and requires the tag to equal v{project.version}.
  • sdist and wheel builders use the immutable tag and pinned Maturin v1.14.1.
  • Non-abi3 wheels cover CPython 3.12/3.13/3.14 for x86_64 Linux, aarch64 Linux, macOS universal2, and Windows x86_64.

Publication boundaries

  • release-assets alone gets contents: write; PyPI publication retains contents: read and the pypi environment.
  • Release tags are passed to gh release upload through RELEASE_TAG rather than shell expression interpolation.
  • Existing GitHub assets are not clobbered; duplicate assets fail closed.
  • PyPI uses pinned pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33, PIPY_TOKEN, no runtime Twine install, no skip-existing, and no token-path attestation claim.
  • GitHub asset attachment and PyPI publication are independent sibling jobs consuming the same verified sdist/wheel artifacts. PyPI no longer needs: release-assets, so a previously failed PyPI publish can be retried even when immutable GitHub assets already exist and correctly reject replacement.

Test-first evidence

  • Initial workflow RED 68e93b349afc44fb6d4ae9450aa9afde0fbe0281 → GREEN 2c95af58af1e1c1bb0947efc5c696941557598f8 covers exact-tag checkout, version matching, pinned tooling, isolated permissions, safe tag transport, pinned PyPA publishing and credential semantics.
  • Asset immutability RED 3ad31e7b667058263c5231c852ce6c0489250a22 → GREEN 0d9d327c8fba49b1b85a194243ea920ceca4f680 removes --clobber.
  • Dispatch RED 3647e605052c988758d21746feb9ecf64b370ac6 → GREEN a10d3fa53c688b1e03628515f8dd6ffc01ec1a83; evidence 4ba34e945e67949400af9b0109574a07c5dd45d0.
  • Recovery RED 64b06c808413c0fe3ddcbfd0d6e9ef8ab7dddb4d → GREEN b51b88c6ee2cf68449ea3b0494607af731bad8a4: contract test requires both publication sinks to depend directly on [sdist, wheels], not on each other.
  • Current governed evidence/head 32030e8640ad2003fe91bfc395a04885aceff95f records independent PyPI recovery while retaining immutable GitHub/PyPI duplicate-filename failure semantics. The corresponding coupling review thread is resolved; unrelated secret-provisioning and macOS operational notes remain current until proven externally.

Acceptance boundary

Protected base remains main@04d0bc21a2a20693bcf16108cd76d394fe844d23; exact current head is 32030e8640ad2003fe91bfc395a04885aceff95f, open, non-Draft and mergeable. Every predecessor-head check/review is historical after the recovery commits. Repository source cannot prove the external pypi environment, the literal PIPY_TOKEN secret, or the first real macOS universal2 artifact. The next canonical release remains the operational acceptance point for those external facts. Merge only after all exact-current-head protected CI/security/package/SBOM/provenance/coverage/review requirements are terminal and clean; no gate bypass, self-approval, force update or credential invention.

Adds a hash-pinnable, PyPI-published artifact path so downstream
consumers (LineageWeave) can depend on fast-mlsirm through a normal
versioned requirement instead of an unhashable git source, which
currently makes every LineageWeave PR fail the org's sandboxed
coverage-evidence review gate (uv export cannot emit --hash for a
git dependency).

Builds sdist + wheels (linux x86_64/aarch64 manylinux2014, macos
universal2, windows x86_64) via maturin-action on GitHub Release
publish, verifies with twine check, attaches the artifacts to the
release, and publishes to PyPI using the existing PIPY_TOKEN/
PIPY_USERNAME org secrets.

See ContextualWisdomLab/.github#1212 for full root-cause evidence.
github-advanced-security[bot]

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds a GitHub Actions workflow that builds source and platform-specific wheel distributions when a release is published. It validates the artifacts, attaches them to the GitHub Release, and publishes them to PyPI.

Changes

PyPI release automation

Layer / File(s) Summary
Release workflow configuration
.github/workflows/publish-pypi.yml
The workflow runs for published releases. It uses read-only contents permission and tag-scoped concurrency.
Distribution artifact builds
.github/workflows/publish-pypi.yml
The workflow builds an sdist with Maturin and builds wheels for Linux x86_64, Linux ARM64, macOS universal2, and Windows x86_64.
Artifact validation and publishing
.github/workflows/publish-pypi.yml
The publish job downloads all artifacts, validates them with Twine, uploads them to the GitHub Release, and publishes them to PyPI with PIPY_USERNAME and PIPY_TOKEN.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🟠 High · up to 6fb42

This PR adds automated package publishing, but the current workflow can execute an unsanitized release tag in a credentialed job, cannot upload release assets with its current permissions, and uses a floating build-tool version that can change released artifacts; merge is not ready until these issues are corrected.

Sequence Diagram(s)

sequenceDiagram
  participant Release as Published release
  participant Actions as GitHub Actions
  participant Builders as Build jobs
  participant Publish as Publish job
  participant GitHub as GitHub Release
  participant PyPI
  Release->>Actions: Trigger workflow
  Actions->>Builders: Run sdist and wheel builds
  Builders-->>Publish: Provide distribution artifacts
  Publish->>Publish: Validate artifacts with Twine
  Publish->>GitHub: Upload release assets
  Publish->>PyPI: Publish distributions
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the workflow that builds and publishes source distributions and wheels on GitHub Release.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/publish-pypi-release-assets

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 new potential issues.

Open in Devin Review

Comment thread .github/workflows/publish-pypi.yml Outdated
Comment thread .github/workflows/publish-pypi.yml Outdated
Comment thread .github/workflows/publish-pypi.yml

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Open in Devin Review

Comment thread .github/workflows/publish-pypi.yml
@opencode-agent opencode-agent Bot added area: ci-cd CI, GitHub Actions, checks, release, or supply chain priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: feature New or expanded product capability labels Aug 22, 2026
@seonghobae

Copy link
Copy Markdown
Contributor Author

@opencode-agent please review — this is a direct test of the review-pipeline fix landed in ContextualWisdomLab/.github#1221 (root cause #3 of ContextualWisdomLab/.github#1212).

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

Open in Devin Review

Comment thread .github/workflows/release-tag.yml
Comment thread .github/workflows/release-tag.yml
@seonghobae
seonghobae enabled auto-merge (squash) August 24, 2026 01:01
@opencode-agent
opencode-agent Bot disabled auto-merge August 24, 2026 02:21
@seonghobae
seonghobae merged commit 8a6badb into main Aug 24, 2026
40 of 41 checks passed
@seonghobae
seonghobae deleted the feat/publish-pypi-release-assets branch August 24, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci-cd CI, GitHub Actions, checks, release, or supply chain priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: feature New or expanded product capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants