Skip to content

Updated CI

Updated CI #228

Workflow file for this run

name: Wheels
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
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: Build wheels on ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
pybuilds: cp3{8,9,10,11,12}-manylinux_x86_64
arch: x86_64
id: linux_x86_64
- os: ubuntu-24.04-arm
pybuilds: cp3{8,9,10,11,12}-manylinux_aarch64
arch: aarch64
id: linux_arm64
- os: macos-13
pybuilds: cp3{8,9,10,11,12}-macosx_x86_64
arch: x86_64
id: macos_x86
- os: macos-15
pybuilds: cp3{8,9,10,11,12}-macosx_arm64
arch: arm64
id: macos_arm64
- os: windows-latest
pybuilds: cp3{8,9,10,11,12}-win_amd64
arch: x86_64
id: windows_amd64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.22.0
- name: Build wheels
# why do I need to specify this cpversion here?
env:
CIBW_BUILD: ${{ matrix.pybuilds }}
CIBW_SKIP: "cp*-manylinux_i686 cp*-musllinux* cp*-win32"
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
name: Upload repaired wheels as artifact
with:
name: ${{ matrix.os }}-${{ strategy.job-index }}-${{ matrix.arch }}
path: |
${{ steps.attest.outputs.bundle-path }}
./wheelhouse/*.whl
./wheelhouse/*.so
./wheelhouse/*.dylib
./wheelhouse/*.lib
./wheelhouse/*.dll
release_artifacts:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
name: Release repaired and tested wheels
needs: build_wheels
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Optional, use if you use setuptools_scm
submodules: true # Optional, use if you have submodules
- name: Download compressed artifacts
id: download
uses: actions/download-artifact@v4
with:
path: ./artifacts
merge-multiple: true
- name: Display structure of downloaded files
run: ls -R ./artifacts
- name: Create release and upload wheels
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "${{ steps.download.outputs.download-path }}/*.whl,${{ steps.download.outputs.download-path }}/*.gz,${{ steps.download.outputs.download-path }}/*.so,${{ steps.download.outputs.download-path }}/*.dylib,${{ steps.download.outputs.download-path }}/*.lib,${{ steps.download.outputs.download-path }}/*.dll"
token: ${{ secrets.GITHUB_TOKEN }}
- name: PyPI Publish
uses: pypa/[email protected]
with:
packages-dir: ${{ steps.download.outputs.download-path }}