Skip to content

update cibuildwheel #43

update cibuildwheel

update cibuildwheel #43

Workflow file for this run

name: Python package
on:
push:
branches:
- '**'
tags-ignore:
- '**'
paths-ignore:
- .pre-commit-config.yaml
pull_request:
release:
types:
- published
jobs:
build_wheels_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_ALL: sh linux-build.sh
CIBW_BEFORE_BUILD: ls {project}/libjpeg-turbo-build
CIBW_SKIP: cp36-* pp*
CIBW_ARCHS_LINUX: auto64
CIBW_REPAIR_WHEEL_COMMAND: LD_LIBRARY_PATH=/project/libjpeg-turbo-build auditwheel repair -w {dest_dir} {wheel}
CIBW_BEFORE_TEST: python -m pip install -r requirements-dev.txt && python generate_test_images.py
CIBW_TEST_COMMAND: cd {project} && python -m unittest discover -s tests
CIBW_TEST_SKIP: '*-musllinux_*'
CIBW_TEST_EXTRAS: test
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_wheels_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_ALL: sh macos-build.sh
CIBW_BEFORE_BUILD: ls {project}/libjpeg-turbo-build
CIBW_SKIP: cp36-* pp*
CIBW_REPAIR_WHEEL_COMMAND: DYLD_LIBRARY_PATH=./libjpeg-turbo-build delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
CIBW_BEFORE_TEST: python -m pip install -r requirements-dev.txt && python generate_test_images.py
CIBW_TEST_COMMAND: cd {project} && python -m unittest discover -s tests
CIBW_TEST_EXTRAS: test
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_wheels_windows:
runs-on: windows-latest
strategy:
matrix:
arch:
- AMD64
- x86
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Build dependencies
shell: cmd
run: |
python get-nasm.py ${{ matrix.arch }}
set path=%path%;%CD%\nasm-2.14.02
mkdir libjpeg-turbo-build
cd libjpeg-turbo-build
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ../libjpeg-turbo
nmake
cd ..
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: cp36-* pp*
CIBW_ARCHS_WINDOWS: ${{ matrix.arch }}
CIBW_BEFORE_BUILD_WINDOWS: python -m pip install delvewheel
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: python -m delvewheel repair -w {dest_dir} {wheel} --add-path libjpeg-turbo-build --no-dll vcruntime140_1.dll;msvcp140.dll
CIBW_BEFORE_TEST: python -m pip install -r requirements-dev.txt && python generate_test_images.py
CIBW_TEST_COMMAND: cd /d {project} && python -m unittest discover -s tests
CIBW_TEST_SKIP: cp38-win32 cp39-win32 cp310-win32 cp311-win32 cp312-win32 # cp37-win32 has wheels!
CIBW_TEST_EXTRAS: test
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
upload-pypi:
if: github.event_name == 'release' && github.event.action == 'published'
needs: [build_wheels_linux, build_wheels_macos, build_wheels_windows]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}