Skip to content

Add free-threading wheels (missing!) #166

Add free-threading wheels (missing!)

Add free-threading wheels (missing!) #166

Workflow file for this run

name: Release
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
paths:
- .github/workflows/release.yml
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
env:
# Latest Jupyter requires this to acknowledge deprecation
JUPYTER_PLATFORM_DIRS: 1
jobs:
release_check:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- if: ${{ github.ref == 'refs/heads/main' }}
run: |
pip install packaging
python .ci/release_check.py
- id: tag
run: echo "tag=$(python version.py)" >> $GITHUB_OUTPUT
wheels:
needs: release_check
name: ${{ matrix.py }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-latest, ubuntu-24.04-arm, windows-11-arm]
py: [cp39, cp310, cp311, cp312, cp313, cp313t, cp314, cp314t]
exclude:
- os: ubuntu-24.04-arm
py: cp39
- os: windows-11-arm
py: cp39
- os: windows-11-arm
py: cp310
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: astral-sh/setup-uv@v6
- uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.py }}-*
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.py }}-${{ matrix.os }}
path: ./wheelhouse/*.whl
sdist:
needs: release_check
name: source package
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pipx run build --sdist
- run: python -m pip install --upgrade pip setuptools pytest
- run: python -m pip install -v $(echo dist/iminuit-*)
- run: python -m pytest
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
upload:
if: ${{ github.ref == 'refs/heads/main' }}
needs: [wheels, sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/iminuit/
permissions:
id-token: write
attestations: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: "*"
merge-multiple: true
path: dist
- name: Generate artifact attestation for sdist and wheels
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
with:
subject-path: "dist/iminuit-*"
- uses: pypa/gh-action-pypi-publish@release/v1
release:
if: ${{ github.ref == 'refs/heads/main' }}
needs: [release_check, upload]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: softprops/action-gh-release@v2
with:
name: v${{ needs.release_check.outputs.tag }}
tag_name: v${{ needs.release_check.outputs.tag }}
target_commitish: ${{ github.ref_name }}
generate_release_notes: true