ci: add release workflow for multi-platform PyPI wheels#8
Merged
Conversation
Triggers on `v*` tag push (or manual workflow_dispatch). Builds wheels for: - Linux x86_64 + aarch64 (manylinux via PyO3/maturin-action) - macOS x86_64 + aarch64 - Windows x86_64 × Python 3.10 / 3.11 / 3.12 / 3.13 Plus a sdist job so platforms without a prebuilt wheel can fall back to a source build. A final `publish` job downloads every artifact and uploads them to PyPI via Trusted Publishing (OIDC) — no long-lived token in repo secrets. The publish step gates on tag push, so manual runs are build-only dry runs. To use: 1. On PyPI, configure a Trusted Publisher for `hebb-py` (owner: hebb-project, repo: hebb, workflow: release.yml, environment: pypi). See the URL in the workflow comment. 2. `git tag v0.1.1 && git push --tags` — workflow runs. For pre-Trusted-Publishing setup, swap the OIDC `permissions: id-token: write` block for a `MATURIN_PYPI_TOKEN` env var sourced from a repo secret.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds `.github/workflows/release.yml` that builds wheels for every common platform/Python combo and publishes them to PyPI on a tag push. Closes the alpha-launch loop: tag `v0.1.1` → wheels appear on PyPI within ~10 minutes.
Matrix
20 wheels + 1 sdist per release.
Publish path
Uses PyPI Trusted Publishing (OIDC). The `publish` job has `permissions: id-token: write` and no long-lived token in repo secrets. Gated on tag push, so manual `workflow_dispatch` runs are build-only dry runs.
Setup (one-time, before tagging)
Releasing
# bump version in Cargo.toml + python/Cargo.toml + pyproject.toml git tag v0.1.1 git push --tagsWatch the workflow under Actions; on completion, `hebb-py` v0.1.1 is on PyPI.
Alternative auth (if you'd rather not set up Trusted Publishing right now)
Swap the publish step's OIDC block for a token-based env var:
```yaml
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
```
…and add `PYPI_API_TOKEN` as a repo secret.
Test plan