legacy macos fixup #567
This file contains 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: Wheels | |
on: | |
pull_request: | |
push: | |
env: | |
REPO_DIR: pillow-avif-plugin | |
BUILD_DEPENDS: "" | |
TEST_DEPENDS: "pytest pillow" | |
MACOSX_DEPLOYMENT_TARGET: "10.10" | |
WHEEL_SDIR: wheelhouse | |
CONFIG_PATH: pillow-avif-plugin/wheelbuild/config.sh | |
LIBAVIF_VERSION: 88d3dccda111f6ccbcccd925179f67e7d6fdf4ff | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
legacy: | |
name: ${{ matrix.os-name }} ${{ matrix.arch == 'x86' && 'x86_64' || matrix.os-type == 'macos' && 'arm64' || 'aarch64' }} (${{ matrix.python }}) | |
runs-on: ${{ matrix.os-type == 'ubuntu' && 'ubuntu-latest' || (matrix.os-type == 'macos' && (matrix.arch == 'x86' || matrix.python == '2.7' || matrix.python == '3.7')) && 'macos-13' || 'macos-latest' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os-type: [ "ubuntu", "macos" ] | |
python: [ "2.7", "3.7", "3.8" ] | |
arch: [ "x86", "arm" ] | |
manylinux-version: [ "2014" ] | |
mb-ml-libc: [ "manylinux", "musllinux" ] | |
exclude: | |
- python: "2.7" | |
os-type: "ubuntu" | |
manylinux-version: "2014" | |
- python: "3.7" | |
os-type: "ubuntu" | |
manylinux-version: "2014" | |
- python: "2.7" | |
os-type: "ubuntu" | |
arch: "arm" | |
- python: "2.7" | |
mb-ml-libc: "musllinux" | |
- python: "3.7" | |
mb-ml-libc: "musllinux" | |
- arch: "arm" | |
mb-ml-libc: "musllinux" | |
- os-type: "macos" | |
mb-ml-libc: "musllinux" | |
include: | |
- os-type: "macos" | |
arch: "arm" | |
os-name: "macOS 11.0" | |
dist-name: "macos-11.0" | |
- os-type: "macos" | |
arch: "x86" | |
os-name: "macOS 10.10" | |
dist-name: "macos-10.10" | |
- os-type: "ubuntu" | |
os: "ubuntu-latest" | |
python: "2.7" | |
arch: "x86" | |
manylinux-version: "2010" | |
os-name: "manylinux2010" | |
- os-type: "ubuntu" | |
os: "ubuntu-latest" | |
python: "3.7" | |
arch: "x86" | |
manylinux-version: "2010" | |
os-name: "manylinux2010" | |
- os-type: "ubuntu" | |
os: "ubuntu-latest" | |
manylinux-version: "2014" | |
os-name: "manylinux2014" | |
- mb-ml-libc: "musllinux" | |
os-type: "ubuntu" | |
os-name: "musllinux" | |
env: | |
BUILD_COMMIT: HEAD | |
PLAT: ${{ matrix.arch == 'x86' && 'x86_64' || (matrix.os-type == 'macos' && 'arm64') || 'aarch64' }} | |
MB_PYTHON_VERSION: ${{ matrix.python }} | |
TRAVIS_OS_NAME: ${{ matrix.os-name }} | |
MB_ML_VER: ${{ matrix.mb-ml-libc == 'musllinux' && '_1_1' || matrix.manylinux-version }} | |
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch == 'arm' && '11.0' || '10.10' }} | |
MB_ML_LIBC: ${{ matrix.mb-ml-libc }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: pillow-avif-plugin | |
- name: Checkout multibuild | |
uses: actions/checkout@v4 | |
with: | |
repository: multi-build/multibuild | |
path: multibuild | |
ref: ${{ (matrix.os == 'macos-latest' || (env.PLAT == 'arm64' && matrix.python != '2.7')) && '88146e74ebc86baf97b6fec448ef766d64326582' || '34e970c4bc448b73af0127615fc4583b4f247369' }} | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'arm' }} | |
- name: Setup env_vars | |
run: | | |
cat <<'EOF' >> env_vars.sh | |
export LIBAVIF_VERSION=${{ env.LIBAVIF_VERSION }}" | |
export GITHUB_ACTIONS=1" | |
EOF | |
# - name: Cache build | |
# id: build-cache | |
# uses: actions/cache@v3 | |
# with: | |
# path: pillow-avif-plugin/depends/libavif-${{ env.LIBAVIF_VERSION }} | |
# key: | |
# ${{ env.LIBAVIF_VERSION }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*') }}-${{ matrix.os }}-${{ env.PLAT }} | |
- name: Cache ccache/sccache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
ccache | |
sccache | |
key: | |
cache-${{ matrix.os }}-${{ matrix.os-name }}-${{ env.PLAT }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*', 'pillow-avif-plugin/**/*.py', 'pillow-avif-plugin/**/*.c') }}-${{ matrix.python }} | |
restore-keys: | | |
cache-${{ matrix.os }}-${{ matrix.os-name }}-${{ env.PLAT }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*', 'pillow-avif-plugin/**/*.py', 'pillow-avif-plugin/**/*.c') }}-${{ matrix.python }} | |
cache-${{ matrix.os }}-${{ matrix.os-name }}-${{ env.PLAT }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*', 'pillow-avif-plugin/**/*.py', 'pillow-avif-plugin/**/*.c') }} | |
cache-${{ matrix.os }}-${{ matrix.os-name }}-${{ env.PLAT }}- | |
- name: Build Wheel | |
run: pillow-avif-plugin/wheelbuild/build.sh | |
- name: Fix Directory Permissions | |
run: | | |
sudo chown -R $(whoami):$(id -ng) ccache ||: | |
sudo chown -R $(whoami):$(id -ng) sccache ||: | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.dist-name || matrix.os-name }}-${{ matrix.arch == 'x86' && 'x86_64' || (matrix.os-type == 'macos' && 'arm64') || 'aarch64' }}-python${{ matrix.python }} | |
path: wheelhouse/*.whl | |
build-native-wheels: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: "macOS 10.10 x86_64" | |
os: macos-13 | |
cibw_arch: x86_64 | |
build: "cp3{9,10,11}*" | |
macosx_deployment_target: "10.10" | |
dist_name: "macos-10.10-x86_64" | |
- name: "macOS 10.13 x86_64" | |
os: macos-13 | |
cibw_arch: x86_64 | |
build: "cp3{12,13}*" | |
macosx_deployment_target: "10.13" | |
dist_name: "macos-10.13-x86_64" | |
- name: "macOS 10.15 x86_64" | |
os: macos-13 | |
cibw_arch: x86_64 | |
build: "pp310*" | |
macosx_deployment_target: "10.15" | |
dist_name: "macos-10.15-x86_64" | |
- name: "macOS arm64" | |
os: macos-latest | |
cibw_arch: arm64 | |
macosx_deployment_target: "11.0" | |
dist_name: "macos-11-arm64" | |
- name: "manylinux2014 x86_64" | |
os: ubuntu-latest | |
cibw_arch: x86_64 | |
build: "*manylinux*" | |
dist_name: "manylinux2014-x86_64" | |
- name: "musllinux x86_64" | |
os: ubuntu-latest | |
cibw_arch: x86_64 | |
build: "*musllinux*" | |
dist_name: "musllinux-x86_64" | |
- name: "manylinux_2_28 x86_64" | |
os: ubuntu-latest | |
cibw_arch: x86_64 | |
build: "*manylinux*" | |
manylinux: "manylinux_2_28" | |
dist_name: "manylinux_2_28" | |
- name: "manylinux2014 aarch64" | |
os: ubuntu-24.04-arm | |
cibw_arch: aarch64 | |
build: "*manylinux*" | |
dist_name: "manylinux2014-aarch64" | |
- name: "musllinux aarch64" | |
os: ubuntu-24.04-arm | |
cibw_arch: aarch64 | |
build: "*musllinux*" | |
dist_name: "musllinux-aarch64" | |
- name: "manylinux_2_28 aarch64" | |
os: ubuntu-24.04-arm | |
cibw_arch: aarch64 | |
build: "*manylinux*" | |
manylinux: "manylinux_2_28" | |
dist_name: "manylinux_2_28-aarch64" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout multibuild | |
uses: actions/checkout@v4 | |
with: | |
repository: multi-build/multibuild | |
path: multibuild | |
ref: 42d761728d141d8462cd9943f4329f12fe62b155 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install cibuildwheel | |
run: | | |
python3 -m pip install -r .ci/requirements-cibw.txt | |
- name: Build wheels | |
run: | | |
python3 -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_ARCHS: ${{ matrix.cibw_arch }} | |
CIBW_BUILD: ${{ matrix.build }} | |
CIBW_ENABLE: cpython-prerelease cpython-freethreading pypy | |
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux }} | |
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ matrix.manylinux }} | |
CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: ${{ matrix.manylinux }} | |
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }} | |
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }} | |
CIBW_SKIP: "pp36-* pp37-* pp38-* cp36-* cp37-* cp38-* pp39-* pp311-*" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.dist_name }} | |
path: ./wheelhouse/*.whl | |
windows: | |
name: Windows ${{ matrix.cibw_arch }} | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- cibw_arch: AMD64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install cibuildwheel | |
run: | | |
python.exe -m pip install -r .ci/requirements-cibw.txt | |
- name: Prepare for build | |
run: | | |
choco install nasm --no-progress | |
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH | |
python.exe -m pip install meson | |
& python.exe winbuild\build_prepare.py -v --architecture=${{ matrix.cibw_arch }} | |
shell: pwsh | |
- name: Build wheels | |
run: | | |
setlocal EnableDelayedExpansion | |
for %%f in (winbuild\build\license\*) do ( | |
set x=%%~nf | |
echo. >> LICENSE | |
echo ===== %%~nf ===== >> LICENSE | |
echo. >> LICENSE | |
type %%f >> LICENSE | |
) | |
call winbuild\\build\\build_env.cmd | |
%pythonLocation%\python.exe -m cibuildwheel . --output-dir wheelhouse | |
env: | |
CIBW_ARCHS: ${{ matrix.cibw_arch }} | |
CIBW_BEFORE_ALL: "{package}\\winbuild\\build\\build_dep_all.cmd" | |
CIBW_CACHE_PATH: "C:\\cibw" | |
CIBW_ENABLE: cpython-prerelease cpython-freethreading pypy | |
CIBW_TEST_SKIP: "*-win_arm64 pp*" | |
CIBW_SKIP: "pp36-* pp37-* pp38-* pp39-* pp311-* cp36-* cp37-* cp38-*" | |
CIBW_TEST_COMMAND: 'docker run --rm | |
-v {project}:C:\pillow-avif-plugin | |
-v C:\cibw:C:\cibw | |
-v %CD%\..\venv-test:%CD%\..\venv-test | |
-e CI -e GITHUB_ACTIONS | |
mcr.microsoft.com/windows/servercore:ltsc2022 | |
powershell C:\pillow-avif-plugin\.github\workflows\wheels-test.ps1 %CD%\..\venv-test' | |
shell: cmd | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-windows-${{ matrix.cibw_arch }} | |
path: ./wheelhouse/*.whl | |
sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
cache: pip | |
cache-dependency-path: "Makefile" | |
- run: make sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-sdist | |
path: dist/*.tar.gz | |
success: | |
needs: [legacy, windows, build-native-wheels, sdist] | |
runs-on: ubuntu-latest | |
name: Build Successful | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: dist-* | |
path: dist | |
merge-multiple: true | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels | |
path: ./*.whl | |
- name: Upload Release | |
uses: fnkr/github-action-ghr@v1.3 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GHR_PATH: . | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |