Skip to content

Split PyPI release into per-platform tag workflows with scm-pinned wheel publishing#77

Draft
jf--- with Copilot wants to merge 2 commits into
mainfrom
copilot/pypi-release-on-tag-push
Draft

Split PyPI release into per-platform tag workflows with scm-pinned wheel publishing#77
jf--- with Copilot wants to merge 2 commits into
mainfrom
copilot/pypi-release-on-tag-push

Conversation

Copilot AI commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

This changes the release path from a single tag-driven publish workflow to independent Linux/macOS/Windows wheel pipelines that each build, test, and publish on bare X.Y.Z tags. It also moves package versioning to setuptools-scm so tag builds publish the tag version consistently and reject mismatched wheel artifacts before upload.

  • Per-platform release workflows

    • Replaced the monolithic release workflow with:
      • build.yml for Linux
      • build-macos.yml
      • build-windows.yml
    • Each workflow now follows build-wheel -> test-wheel -> publish
    • Publish is tag-gated and uses PyPI trusted publishing via OIDC
    • Added per-workflow concurrency and paths-ignore so platform pipelines rerun independently and avoid unnecessary CI burn
  • Wheel-first release behavior

    • Build jobs produce cp312/abi3 wheel artifacts per platform
    • Test jobs install the built wheel into a clean venv on a separate runner image and run the test suite there
    • Publish jobs download only their platform artifacts and upload with skip-existing for idempotent reruns
  • Versioning hardening

    • Switched pyproject.toml to scikit_build_core.metadata.setuptools_scm
    • Added setuptools-scm to build requirements and local_scheme = "no-local-version"
    • Injected SETUPTOOLS_SCM_PRETEND_VERSION_FOR_COMPAS_CGAL on tag builds so CI-side tree mutations cannot produce dev releases
    • Updated runtime version lookup to read installed package metadata instead of a hardcoded __version__
  • Publish-time safety checks

    • Added an explicit guard that fails publish if no wheel artifacts were downloaded
    • Added a tag/version assertion so every wheel filename must match GITHUB_REF_NAME before upload
env:
  CIBW_ENVIRONMENT: SETUPTOOLS_SCM_PRETEND_VERSION_FOR_COMPAS_CGAL=${{ github.ref_type == 'tag' && github.ref_name || '' }}

- name: Assert wheel versions match the tag
  run: |
    for whl in dist/*.whl; do
      v=$(basename "$whl" | cut -d- -f2)
      [ "$v" = "$GITHUB_REF_NAME" ] || exit 1
    done

Copilot AI linked an issue Jul 24, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add PyPI release workflow for tag-triggered builds Split PyPI release into per-platform tag workflows with scm-pinned wheel publishing Jul 24, 2026
Copilot AI requested a review from jf--- July 24, 2026 12:08
Copilot finished work on behalf of jf--- July 24, 2026 12:08
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.

pypi release on tag push

2 participants