Skip to content

[AAASM-1217] ✨ (ci): Add matrix wheel build + PyPI Trusted Publisher workflow#55

Merged
Chisanan232 merged 7 commits into
masterfrom
v0.0.1/AAASM-1217/feat/maturin_release_workflow
May 23, 2026
Merged

[AAASM-1217] ✨ (ci): Add matrix wheel build + PyPI Trusted Publisher workflow#55
Chisanan232 merged 7 commits into
masterfrom
v0.0.1/AAASM-1217/feat/maturin_release_workflow

Conversation

@Chisanan232
Copy link
Copy Markdown
Contributor

Description

Adds .github/workflows/release-python.yml implementing the GitHub Actions release pipeline called out in Story AAASM-1202:

  • Triggers: v*.*.* tag push (real release) and workflow_dispatch (dry-run / staged validation).
  • Build matrix (5 jobs):
    • build-sdist — pure-Python source distribution via maturin sdist
    • build-linux-x86_64 — manylinux_x86_64 wheel
    • build-linux-aarch64 — manylinux_aarch64 wheel
    • build-macos-arm64 — macosx_arm64 wheel (macos-14, Apple silicon)
    • build-macos-x86_64 — macosx_x86_64 wheel (macos-13, Intel)
  • Binary staging: each platform job downloads the prebuilt aasm sidecar binary from AI-agent-assembly/agent-assembly releases and places it at agent_assembly/bin/aasm so maturin's include glob picks it up at build time. If the upstream asset isn't published yet, the job logs a warning and ships an SDK-only wheel.
  • Publish job: gated on all 5 build jobs; downloads every wheels-* artifact, then uploads via pypa/gh-action-pypi-publish using PyPI Trusted Publisher (OIDC). No long-lived API token in repo secrets. Guarded by if: github.event_name == 'push' so workflow_dispatch is build-only.

⚠️ Stacked on AAASM-1215 (PR #53). Cherry-picked commits for the maturin build-backend switch are included so the branch builds standalone; they drop out on rebase once #53 merges.

PyPI Trusted Publisher setup (one-time, outside this PR)

After merge, complete these manual steps before tagging a release:

  1. On https://pypi.org/manage/account/publishing/, add a "Pending Trusted Publisher" for project agent-assembly with:
    • Owner: AI-agent-assembly
    • Repository: python-sdk
    • Workflow filename: release-python.yml
    • Environment: pypi
  2. In this repo's Settings → Environments → create environment pypi (optionally with required reviewers).
  3. After the first successful publish, PyPI converts the pending publisher to active.

Type of Change

  • 🔧 Configuration

Breaking Changes

  • No

New workflow file; nothing else touched. No effect on existing CI.

Related Issues

Testing

  • Manual testing performed

Validations:

  • python -c "import yaml; yaml.safe_load(open('.github/workflows/release-python.yml'))" parses cleanly
  • All 6 jobs verified by structural assertions (publish.needs covers all 5 build jobs; publish.if guards tag-push; publish.environment.name == 'pypi')
  • Untrusted-input safety: no ${{ github.event.* }} interpolation in any run: script — repo name is sourced from workflow env: only

End-to-end exercise (matrix build + dry-run publish path) is the verification scope of AAASM-1219.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex logic
  • Documentation updated if needed
  • All tests passing

Commits (this PR's scope only — AAASM-1217)

  1. ✨ (ci): Add release-python.yml skeleton with triggers and permissions
  2. ✨ (ci): Add build-sdist job for pure-Python source distribution
  3. ✨ (ci): Add manylinux_x86_64 wheel build job (PyO3/maturin-action)
  4. ✨ (ci): Add manylinux_aarch64 wheel build job
  5. ✨ (ci): Add macosx_arm64 wheel build job
  6. ✨ (ci): Add macosx_x86_64 wheel build job
  7. ✨ (ci): Add PyPI Trusted Publisher publish job gated on all build jobs

Workflow header — triggered on v*.*.* tag push (publish path) and
workflow_dispatch (dry-run path). id-token: write permission and
no stored PyPI token: the publish step uses Trusted Publisher OIDC
per the F112 spec in AAASM-1202.

Real matrix build + publish jobs added in follow-up commits.

AAASM-1217
Replaces the noop placeholder. Produces dist/*.tar.gz via maturin-action's
sdist command — the source archive that lets users build from source
without a prebuilt wheel.

Artifact name 'wheels-sdist' chosen so the publish job's
`pattern: wheels-*` glob picks it up alongside per-platform wheels.

AAASM-1217
First platform wheel job. Three notable parts:

1. Stage step downloads the prebuilt aasm-linux-x86_64 artifact from
   the upstream agent-assembly repo and places it at
   agent_assembly/bin/aasm — picked up by maturin's include glob.
2. Untrusted-input safety: AASM_REPO is sourced via env: from the
   workflow-level env var (already a static string), not interpolated
   directly into the run script.
3. maturin-action with manylinux: auto produces a wheel with the
   correct manylinux platform tag for broad pip compatibility.

If the upstream binary isn't published yet, the step logs a warning
and continues, producing an SDK-only wheel.

AAASM-1217
Same shape as the x86_64 job; maturin-action's QEMU-based cross-build
support handles aarch64 from ubuntu-latest. Downloads
aasm-linux-aarch64 from upstream agent-assembly releases.

AAASM-1217
Runs on macos-14 (Apple silicon) and produces the wheel for the
common modern Mac. Native build — no cross-compile overhead — so
maturin-action picks up the host target directly.

AAASM-1217
Runs on macos-13 (Intel runner) for the legacy Mac target. Same
structure as the arm64 job; binary download pattern is
aasm-macos-x86_64 to match the expected upstream release asset name.

AAASM-1217
Downloads every wheels-* artifact (sdist + 4 platform wheels) into
dist/ and uploads them via pypa/gh-action-pypi-publish using the
Trusted Publisher OIDC flow — no long-lived PyPI API token is
stored in repo secrets.

`if:` guard ensures the publish step only fires on actual v*.*.*
tag pushes; workflow_dispatch runs build only (dry-run).

`environment: pypi` links to the GitHub Environment that PyPI's
Trusted Publisher registration will check against. Setup steps
(register publisher on pypi.org, create the pypi env in repo
settings) documented in the PR description for AAASM-1217.

AAASM-1217
@Chisanan232 Chisanan232 force-pushed the v0.0.1/AAASM-1217/feat/maturin_release_workflow branch from 3923347 to 8df9d2a Compare May 23, 2026 04:59
@Chisanan232 Chisanan232 merged commit a3c1e8f into master May 23, 2026
@Chisanan232 Chisanan232 deleted the v0.0.1/AAASM-1217/feat/maturin_release_workflow branch May 23, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant