Build & Publish wheels #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Publish wheels | |
on: | |
workflow_dispatch | |
jobs: | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
environment: release | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Build sdist | |
run: pipx run build --sdist | |
- name: Install sdist | |
run: pip install dist/*.tar.gz | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
environment: release | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build wheels | |
uses: joerick/cibuildwheel@v2.21.2 | |
env: | |
CIBW_TEST_SKIP: "*" | |
CIBW_SKIP: "cp39-win_arm64" | |
- name: Build win_arm64 wheels | |
if: matrix.os == 'windows-latest' | |
uses: joerick/cibuildwheel@v2.21.2 | |
env: | |
CIBW_TEST_SKIP: "*" | |
CIBW_BUILD: "cp39-win_arm64" | |
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >- | |
delvewheel repair -w {dest_dir} {wheel} --add-path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.40.33807\arm64\Microsoft.VC143.CRT" | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_wheels_ubuntu_manylinux: | |
name: Build x86 manylinux wheels on ubuntu-latest | |
runs-on: ubuntu-latest | |
environment: release | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build wheels | |
uses: joerick/cibuildwheel@v2.21.2 | |
env: | |
CIBW_ENVIRONMENT_LINUX: CFLAGS="-D_mm256_cvtsi256_si32(x)=_mm256_extract_epi32((x),0)" | |
CIBW_SKIP: "*aarch64 *ppc64le *s390x *armv7l *-musllinux*" | |
CIBW_TEST_SKIP: "*" | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_wheels_ubuntu_musllinux: | |
name: Build x86 musllinux wheels on ubuntu-latest | |
runs-on: ubuntu-latest | |
environment: release | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build wheels | |
uses: joerick/cibuildwheel@v2.21.2 | |
env: | |
CIBW_SKIP: "*aarch64 *ppc64le *s390x *armv7l *-manylinux*" | |
CIBW_TEST_SKIP: "*" | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_wheels_qemu: | |
name: Build wheels qemu on ubuntu-latest | |
runs-on: ubuntu-latest | |
environment: release | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Build wheels | |
uses: joerick/cibuildwheel@v2.21.2 | |
env: | |
CIBW_SKIP: "*x86_64 *i686" | |
CIBW_TEST_SKIP: "*" | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
upload_pypi: | |
name: Publish to PyPI | |
needs: [build_wheels, build_wheels_qemu, build_wheels_ubuntu_manylinux, build_wheels_ubuntu_musllinux, build_sdist] | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |