Skip to content

Bump actions/setup-python from 5 to 6 in the actions group #86

Bump actions/setup-python from 5 to 6 in the actions group

Bump actions/setup-python from 5 to 6 in the actions group #86

Workflow file for this run

name: Build and Publish Wheels
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
release:
types:
- published
jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
with:
submodules: true
- name: Build SDist
run: pipx run build --sdist
- name: Check metadata
run: pipx run twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist-sdist
path: dist/*.tar.gz
build_wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-13, macos-15, windows-2025]
python-version: ["3.13"]
steps:
- uses: actions/checkout@v5
with:
submodules: true
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip/uv.
run: |
python -m pip install --upgrade pip uv
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Set min macOS version
if: runner.os == 'macOS'
run: |
echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> $GITHUB_ENV
- name: Build wheels on ${{ matrix.os }} using cibuildwheel
uses: pypa/[email protected]
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BUILD: "cp310-* cp311-* cp312-*"
CIBW_BUILD_FRONTEND: "build[uv]"
CIBW_SKIP: "pp* *-musllinux_*"
CIBW_ARCHS: auto64
CIBW_BEFORE_ALL_LINUX: bash .github/install_bazel.sh
CIBW_ENVIRONMENT_LINUX: PATH=$PATH:/opt/python/cp312-cp312/bin:$HOME/bin
CIBW_TEST_REQUIRES: "pytest jax[cpu]"
CIBW_TEST_COMMAND: pytest {project}/tests
MACOSX_DEPLOYMENT_TARGET: "11.0"
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64:latest
CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/manylinux_2_28_aarch64:latest
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
- name: Verify clean directory
run: git diff --exit-code
shell: bash
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl
name: dist-${{ matrix.os }}
upload_all:
name: Upload if release
needs: [build_wheels, build_sdist]
runs-on: ubuntu-24.04
if: github.event_name == 'release' && github.event.action == 'published'
permissions:
id-token: write
steps:
- uses: actions/setup-python@v6
with:
python-version: 3.13
- uses: actions/download-artifact@v5
with:
path: dist
pattern: dist-*
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}