Skip to content

Bump pillow from 10.1.0 to 10.4.0 #224

Bump pillow from 10.1.0 to 10.4.0

Bump pillow from 10.1.0 to 10.4.0 #224

# Builds on all branches & PRs
# Deploys to PyPi on "release".
name: Build, test and publish
on:
push:
branches:
- master
tags:
- "*"
pull_request: {}
jobs:
build:
runs-on: ${{ matrix.os }}
name: Build Wheels
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-latest
arch: aarch64
- os: macos-12
arch: x86_64
- os: macos-14
arch: arm64
- os: windows-2019
arch: x86
- os: windows-2019
arch: AMD64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Rewrite version for dev if not tag
if: "!startsWith(github.ref, 'refs/tags/')"
shell: bash
run: |
perl -i -pe "s/__version__\s*=\s*'(.*?)(\.rc.*|\.a.*|\.post.*)?'/__version__='\1.dev0+${GITHUB_SHA::8}'/" setup.py
- name: Note version
shell: bash
run: |
echo "PACKAGE_VERSION=$(python3 -- ./setup.py --version)" >> $GITHUB_ENV
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
# desmume build deps
- name: Install MacOS build deps
if: runner.os == 'macOS'
run: |
brew install coreutils gcc sdl2 meson glib
- name: "Windows: Set env: AMD64"
if: runner.os == 'Windows' && matrix.arch == 'AMD64'
shell: bash
run: |
echo CIBW_ENVIRONMENT_WINDOWS="FASTBUILD=1" >> $GITHUB_ENV
- name: "Windows: Set env: x64"
if: runner.os == 'Windows' && matrix.arch == 'x86'
shell: bash
run: |
echo CIBW_ENVIRONMENT_WINDOWS="FASTBUILD=1 BUILD_32=1" >> $GITHUB_ENV
- name: "MacOS 12: Set deployment target"
if: matrix.os == 'macos-12'
run: |
echo "MACOSX_DEPLOYMENT_TARGET=12.0" >> $GITHUB_ENV
- name: "MacOS 14: Set deployment target & fix arch flags"
if: matrix.os == 'macos-14'
run: |
echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV
# This really shouldn't be needed though??
echo "CPPFLAGS=-arch arm64" >> $GITHUB_ENV
- name: Add msbuild to PATH
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
# end desume build deps
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD_FRONTEND: build
CIBW_SKIP: "*musllinux*"
CIBW_BEFORE_ALL_LINUX: "{package}/build-manylinux.sh"
CIBW_BEFORE_BUILD_WINDOWS: "rm -rf desmume_src/desmume/src/frontend/interface/windows/__bins"
CIBW_ENVIRONMENT_LINUX: 'CXXFLAGS="-DFORCE_AVX512_0=1 -D_POSIX_C_SOURCE=199309L" CFLAGS="-D_POSIX_C_SOURCE=199309L"'
CIBW_ENVIRONMENT_WINDOWS: "${{ env.CIBW_ENVIRONMENT_WINDOWS }}"
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64
CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/manylinux_2_28_aarch64
CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: quay.io/pypa/manylinux_2_28_aarch64
CIBW_ARCHS: ${{ matrix.arch }}
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist/*.whl
build-sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build SDist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist/*.tar.gz
build_mingw:
runs-on: windows-2019
name: Msys Wheel
strategy:
fail-fast: false
matrix:
include: [
{ msystem: MINGW64, arch: x86_64, path: mingw64 },
{ msystem: MINGW32, arch: i686, path: mingw32 }
]
steps:
- name: Install MSys2 and dependencies
uses: msys2/setup-msys2@v2
with:
update: true
msystem: ${{ matrix.msystem }}
install: >-
git
unzip
mingw-w64-${{ matrix.arch }}-curl
mingw-w64-${{ matrix.arch }}-python
mingw-w64-${{ matrix.arch }}-python-pip
mingw-w64-${{ matrix.arch }}-python-pillow
mingw-w64-${{ matrix.arch }}-openssl
mingw-w64-${{ matrix.arch }}-toolchain
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Rewrite version for dev if not tag
if: "!startsWith(github.ref, 'refs/tags/')"
shell: msys2 {0}
run: |
perl -i -pe "s/__version__\s*=\s*'(.*?)(\.rc.*|\.a.*|\.post.*)?'/__version__='\1.dev0+${GITHUB_SHA::8}'/" setup.py
- name: Note version and add VS to path
shell: msys2 {0}
run: |
echo "PACKAGE_VERSION=$(python3 -- ./setup.py --version)" >> $GITHUB_ENV
- name: Upgrade pip
shell: msys2 {0}
run: |
python -m pip install --upgrade pip wheel
- name: Build Python wheels # microsoft/setup-msbuild@v1.3.1 doesn't work here
shell: msys2 {0}
run: |
PATH="$PATH:/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin" python setup.py bdist_wheel
env:
BUILD_32: "${{ matrix.arch == 'x86' && '1' || '' }}"
FASTBUILD: "1"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-msys2-py-${{ matrix.msystem }}
path: dist/*.whl
deploy:
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
- build-sdist
runs-on: ubuntu-latest
name: Deploy wheels to PyPI
steps:
- name: Download wheels
uses: actions/download-artifact@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
pip install twine
- name: Publish wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload wheels*/*.whl wheels*/*.tar.gz