{"id":32638624,"url":"https://github.com/explosion/gha-cibuildwheel","last_synced_at":"2026-06-29T01:31:11.789Z","repository":{"id":321600240,"uuid":"1086463105","full_name":"explosion/gha-cibuildwheel","owner":"explosion","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-22T23:30:26.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-23T04:22:23.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/explosion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-30T13:03:35.000Z","updated_at":"2026-02-22T23:30:30.000Z","dependencies_parsed_at":"2025-10-30T15:09:40.563Z","dependency_job_id":"e60411d9-e2f1-4cb8-a063-6abb46d26731","html_url":"https://github.com/explosion/gha-cibuildwheel","commit_stats":null,"previous_names":["explosion/gha-cibuildwheel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/explosion/gha-cibuildwheel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/explosion%2Fgha-cibuildwheel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/explosion%2Fgha-cibuildwheel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/explosion%2Fgha-cibuildwheel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/explosion%2Fgha-cibuildwheel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/explosion","download_url":"https://codeload.github.com/explosion/gha-cibuildwheel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/explosion%2Fgha-cibuildwheel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34910177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-31T02:03:23.692Z","updated_at":"2026-06-29T01:31:11.767Z","avatar_url":"https://github.com/explosion.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# explosion/gha-cibuildwheel\n\nReusable GitHub Actions workflows for building and publishing Python wheels across Explosion AI projects.\n\n## Overview\n\nThis repository provides two reusable workflows:\n- **`cibuildwheel.yml`**: Builds Python wheels and source distributions, creates GitHub releases\n- **`publish_pypi.yml`**: Publishes releases to PyPI\n\nThe workflows support both:\n- **C-extension packages**: Multi-platform wheel building using cibuildwheel\n- **Pure Python packages**: Universal wheel building without platform-specific compilation\n\n## Usage\n\n### Basic Setup for C-extension Packages\n\nFor packages with C extensions (like spaCy, thinc, cymem, etc.):\n\n#### `.github/workflows/cibuildwheel.yml`\n```yaml\nname: Build\n\non:\n  push:\n    tags:\n      - 'release-v[0-9]+.[0-9]+.[0-9]+**'\n      - 'prerelease-v[0-9]+.[0-9]+.[0-9]+**'\n\njobs:\n  build:\n    uses: explosion/gha-cibuildwheel/cibuildwheel.yml@main\n    secrets:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n#### `.github/workflows/publish_pypi.yml`\n```yaml\nname: Publish to PyPI\n\non:\n  release:\n    types:\n      - published\n\njobs:\n  publish:\n    uses: explosion/gha-cibuildwheel/publish_pypi.yml@main\n    with:\n      pypi-package-name: 'your-package-name'\n```\n\n### Setup for Pure Python Packages\n\nFor pure Python packages (like confection, wasabi, catalogue):\n\n```yaml\nname: Build\n\non:\n  push:\n    tags:\n      - 'release-v[0-9]+.[0-9]+.[0-9]+**'\n      - 'prerelease-v[0-9]+.[0-9]+.[0-9]+**'\n\njobs:\n  build:\n    uses: explosion/gha-cibuildwheel/cibuildwheel.yml@main\n    with:\n      pure-python: true\n    secrets:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n## Workflow: cibuildwheel.yml\n\nHandles wheel building and GitHub release creation.\n\n### Inputs\n\n| Input | Description | Default | Required |\n|-------|-------------|---------|----------|\n| `pure-python` | Whether this is a pure Python package | `false` | No |\n| `package-dir` | Directory containing the package to build | `.` | No |\n| `output-dir` | Output directory for built wheels | `wheelhouse` | No |\n| `config-file` | Path to cibuildwheel config file | `{package}/pyproject.toml` | No |\n| `cibw-archs-linux` | Architectures to build on Linux | `auto` | No |\n| `cibw-env-vars` | JSON object of environment variables for cibuildwheel | `{}` | No |\n| `build-sdist` | Whether to build source distribution | `true` | No |\n| `create-release` | Whether to create a GitHub release | `true` | No |\n| `release-name-prefix` | Prefix to remove from tag for release name | `release-` | No |\n| `prerelease-name-prefix` | Prefix for prerelease tags | `prerelease-` | No |\n| `os-matrix` | JSON array of OS runners to build on | See below | No |\n| `python-version` | Python version for sdist build | `3.11` | No |\n| `cibuildwheel-version` | Version of cibuildwheel to use | `v2.21.3` | No |\n\n**Default OS Matrix:**\n```json\n[\"ubuntu-latest\", \"windows-latest\", \"macos-13\", \"macos-14\"]\n```\n\n### Secrets\n\n| Secret | Description | Required |\n|--------|-------------|----------|\n| `GITHUB_TOKEN` | GitHub token for creating releases | No (uses default if not provided) |\n\n### Advanced Examples\n\n#### Custom OS Matrix\n```yaml\njobs:\n  build:\n    uses: explosion/gha-cibuildwheel/cibuildwheel.yml@main\n    with:\n      os-matrix: '[\"ubuntu-latest\", \"windows-latest\", \"macos-13\", \"macos-14\", \"ubuntu-24.04-arm\"]'\n    secrets:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n#### Custom Environment Variables\n```yaml\njobs:\n  build:\n    uses: explosion/gha-cibuildwheel/cibuildwheel.yml@main\n    with:\n      cibw-env-vars: '{\"CIBW_SOME_OPTION\": \"value\", \"CIBW_BUILD\": \"cp38-*\"}'\n    secrets:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n#### Skip Release Creation\n```yaml\njobs:\n  build:\n    uses: explosion/gha-cibuildwheel/cibuildwheel.yml@main\n    with:\n      create-release: false\n    secrets:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n## Workflow: publish_pypi.yml\n\nHandles PyPI publishing when a GitHub release is published.\n\n### Inputs\n\n| Input | Description | Default | Required |\n|-------|-------------|---------|----------|\n| `pypi-package-name` | PyPI project name (for environment URL) | - | **Yes** |\n\n### Example\n\n```yaml\nname: Publish to PyPI\n\non:\n  release:\n    types:\n      - published\n\njobs:\n  publish:\n    uses: explosion/gha-cibuildwheel/publish_pypi.yml@main\n    with:\n      pypi-package-name: 'spacy'\n```\n\n## How It Works\n\n### C-extension Packages\n1. **Push tag** matching pattern (e.g., `release-v3.7.0`)\n2. **cibuildwheel.yml** triggers:\n   - Builds wheels for all platforms using `cibuildwheel`\n   - Builds source distribution\n   - Creates draft GitHub release with artifacts\n3. **Review and publish** the GitHub release\n4. **publish_pypi.yml** triggers:\n   - Downloads artifacts from release\n   - Publishes to PyPI using trusted publishing (OIDC)\n\n### Pure Python Packages\n1. **Push tag** matching pattern\n2. **cibuildwheel.yml** triggers:\n   - Builds single universal wheel on Ubuntu\n   - Builds source distribution\n   - Creates draft GitHub release with artifacts\n3. **Review and publish** the GitHub release\n4. **publish_pypi.yml** triggers (same as above)\n\n## Requirements\n\n### Repository Setup\n- **pyproject.toml** with build configuration\n- **Trusted publishing** configured on PyPI (recommended)\n- **GitHub environment** named \"pypi\" with deployment protection rules (optional)\n\n### For C-extension Packages\n- **cibuildwheel configuration** in pyproject.toml:\n  ```toml\n  [tool.cibuildwheel]\n  build = \"cp38-* cp39-* cp310-* cp311-* cp312-*\"\n  skip = \"*-musllinux_*\"\n  ```\n\n## Migration Guide\n\n### From Individual Workflows\n\n1. Replace your `.github/workflows/cibuildwheel.yml` with the minimal version above\n2. Replace your `.github/workflows/publish_pypi.yml` with the minimal version above\n3. Add `pypi-package-name` parameter with your actual PyPI package name\n4. For pure Python packages, add `pure-python: true`\n\n### Version Pinning\n\nFor production use, pin to a specific version instead of using `@main`:\n\n```yaml\nuses: explosion/gha-cibuildwheel/cibuildwheel.yml@v1.0.0\n```\n\n## Supported Projects\n\nCurrently used by:\n- **spaCy** - Industrial-strength NLP (C-extension)\n- **thinc** - Functional deep learning (C-extension)\n- **cymem** - Memory management helpers (C-extension)\n- **murmurhash** - Cython bindings for MurmurHash (C-extension)\n- **preshed** - Cython hash tables (C-extension)\n- **srsly** - Serialization utilities (C-extension)\n- **confection** - Configuration system (Pure Python)\n\n## Troubleshooting\n\n### Wheels not building for certain platforms\nCheck your `os-matrix` input includes all required platforms.\n\n### Environment variables not being set\nEnsure `cibw-env-vars` is valid JSON. Test with:\n```bash\necho '{\"CIBW_SOME_OPTION\": \"value\"}' | jq .\n```\n\n### Release not being created\nVerify:\n- Tag matches the pattern (e.g., `release-v1.0.0`)\n- `GITHUB_TOKEN` has appropriate permissions\n- `create-release` is not set to `false`\n\n### PyPI upload fails\nCheck:\n- Trusted publishing is configured correctly\n- `pypi-package-name` matches your actual PyPI project\n- GitHub environment \"pypi\" exists (if using environment protection)\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexplosion%2Fgha-cibuildwheel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexplosion%2Fgha-cibuildwheel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexplosion%2Fgha-cibuildwheel/lists"}