Skip to content

Commit

Permalink
CI fix: pypa/twine#1216
Browse files Browse the repository at this point in the history
  • Loading branch information
bigcat88 committed Jan 25, 2025
1 parent c342e31 commit 8b47a9c
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 31 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/build-cache-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ jobs:
CIBW_BUILD_VERBOSITY: 1

- name: Checking built wheels
run: twine check wheelhouse/*
run: |
pip install "twine>=6.1.0" "packaging>=24.2"
twine check wheelhouse/*
- name: Uploading wheels
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -99,7 +101,9 @@ jobs:
CIBW_BUILD_VERBOSITY: 1

- name: Checking built wheels
run: twine check wheelhouse/*
run: |
pip install "twine>=6.1.0" "packaging>=24.2"
twine check wheelhouse/*
- name: Uploading wheels
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -152,7 +156,9 @@ jobs:
CIBW_BUILD_VERBOSITY: 1

- name: Checking built wheels
run: twine check wheelhouse/*
run: |
pip install "twine>=6.1.0" "packaging>=24.2"
twine check wheelhouse/*
- name: Uploading wheels
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -205,7 +211,9 @@ jobs:
CIBW_BUILD_VERBOSITY: 1

- name: Checking built wheels
run: twine check wheelhouse/*
run: |
pip install "twine>=6.1.0" "packaging>=24.2"
twine check wheelhouse/*
- name: Uploading wheels
uses: actions/upload-artifact@v3
Expand Down
142 changes: 120 additions & 22 deletions .github/workflows/wheels-pi_heif.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,16 @@ jobs:
path: wheelhouse/*.whl
if-no-files-found: error

wheels_linux_cpython:
wheels_linux_cpython_amd64:
strategy:
fail-fast: true
matrix:
cibw_buildlinux: [ manylinux, musllinux ]
cibw_arch: [ "aarch64", "x86_64" ]
name: ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }} • CPython
runs-on: ubuntu-20.04
name: ${{ matrix.cibw_buildlinux }} • AMD64 • CPython
runs-on: ubuntu-24.04
env:
BUILD_DIR: "/tmp/ph_build_stuff"
KEY_HEAD: Pi-Heif-${{ matrix.cibw_arch }}-${{ matrix.cibw_buildlinux }}
KEY_HEAD: Pi-Heif-x86_64-${{ matrix.cibw_buildlinux }}

steps:
- uses: actions/checkout@v4
Expand All @@ -157,11 +156,64 @@ jobs:
cp -r -v ./pi-heif/* .
python3 .github/transform_to-pi_heif.py
- name: Set up QEMU
if: matrix.cibw_arch == 'aarch64'
uses: docker/setup-qemu-action@v3
- name: musllinux preparations
if: matrix.cibw_buildlinux == 'musllinux'
run: echo INSTALL_OS_PACKAGES="apk update && apk --no-cache add $OS_PACKAGES" >> $GITHUB_ENV
env:
OS_PACKAGES: "fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev openjpeg-dev"

- uses: actions/cache@v4
with:
platforms: arm64
path: ${{ env.BUILD_DIR }}
key: ${{ env.KEY_HEAD }}-${{ env.KEY_C_BUILD }}-${{ env.KEY_LINUX_LIBS }}
env:
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux/**') }}
KEY_C_BUILD: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/setup.py') }}

- name: Run cibuildwheel
run: |
python3 -m pip install cibuildwheel==2.21.3
python3 -m cibuildwheel
env:
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, x86_64) }}
CIBW_ARCHS: "x86_64"
CIBW_BEFORE_ALL_LINUX: |
${{ env.INSTALL_OS_PACKAGES }}
python3 {package}/libheif/linux_build_libs.py
CIBW_ENVIRONMENT_LINUX: BUILD_DIR=/host${{ env.BUILD_DIR }} PH_LIGHT_ACTION=1

- name: Checking built wheels
run: |
python3 -m pip install twine
python3 -m twine check wheelhouse/*
- name: Uploading wheels
uses: actions/upload-artifact@v3
with:
name: wheels_pi_heif
path: wheelhouse/*.whl
if-no-files-found: error

- name: Fix cache permissions
run: sudo chmod -R 777 ${{ env.BUILD_DIR }}

wheels_linux_cpython_arm64:
strategy:
fail-fast: true
matrix:
cibw_buildlinux: [ manylinux, musllinux ]
name: ${{ matrix.cibw_buildlinux }} • ARM64 • CPython
runs-on: ubuntu-24.04-arm
env:
BUILD_DIR: "/tmp/ph_build_stuff"
KEY_HEAD: Pi-Heif-aarch64-${{ matrix.cibw_buildlinux }}

steps:
- uses: actions/checkout@v4
- name: Transform to Pi-Heif
run: |
cp -r -v ./pi-heif/* .
python3 .github/transform_to-pi_heif.py
- name: musllinux preparations
if: matrix.cibw_buildlinux == 'musllinux'
Expand All @@ -182,8 +234,8 @@ jobs:
python3 -m pip install cibuildwheel==2.21.3
python3 -m cibuildwheel
env:
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, matrix.cibw_arch) }}
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, aarch64) }}
CIBW_ARCHS: "aarch64"
CIBW_BEFORE_ALL_LINUX: |
${{ env.INSTALL_OS_PACKAGES }}
python3 {package}/libheif/linux_build_libs.py
Expand All @@ -204,17 +256,16 @@ jobs:
- name: Fix cache permissions
run: sudo chmod -R 777 ${{ env.BUILD_DIR }}

wheels_linux_pypy:
wheels_linux_pypy_amd64:
strategy:
fail-fast: true
matrix:
cibw_buildlinux: [ manylinux ]
cibw_arch: [ "aarch64", "x86_64" ]
name: ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }} • PyPy
runs-on: ubuntu-20.04
name: ${{ matrix.cibw_buildlinux }} • AMD64 • PyPy
runs-on: ubuntu-24.04
env:
BUILD_DIR: "/tmp/ph_build_stuff"
KEY_HEAD: Pi-Heif-${{ matrix.cibw_arch }}-${{ matrix.cibw_buildlinux }}
KEY_HEAD: Pi-Heif-x86_64-${{ matrix.cibw_buildlinux }}

steps:
- uses: actions/checkout@v4
Expand All @@ -223,11 +274,58 @@ jobs:
cp -r -v ./pi-heif/* .
python3 .github/transform_to-pi_heif.py
- name: Set up QEMU
if: matrix.cibw_arch == 'aarch64'
uses: docker/setup-qemu-action@v3
- uses: actions/cache@v4
with:
platforms: arm64
path: ${{ env.BUILD_DIR }}
key: ${{ env.KEY_HEAD }}-${{ env.KEY_C_BUILD }}-${{ env.KEY_LINUX_LIBS }}
env:
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux/**') }}
KEY_C_BUILD: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/setup.py') }}

- name: Run cibuildwheel
run: |
python3 -m pip install cibuildwheel==2.21.3
python3 -m cibuildwheel
env:
CIBW_BUILD: ${{ format('pp3*-{0}_{1}', matrix.cibw_buildlinux, x86_64) }}
CIBW_ARCHS: "x86_64"
CIBW_BEFORE_ALL_LINUX: |
yum makecache && yum install -y libjpeg-turbo-devel lcms2-devel
python3 {package}/libheif/linux_build_libs.py
CIBW_ENVIRONMENT_LINUX: BUILD_DIR=/host${{ env.BUILD_DIR }} PH_LIGHT_ACTION=1

- name: Checking built wheels
run: |
python3 -m pip install twine
python3 -m twine check wheelhouse/*
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels_pi_heif
path: wheelhouse/*.whl
if-no-files-found: error

- name: Fix cache permissions
run: sudo chmod -R 777 ${{ env.BUILD_DIR }}

wheels_linux_pypy_arm64:
strategy:
fail-fast: true
matrix:
cibw_buildlinux: [ manylinux ]
name: ${{ matrix.cibw_buildlinux }} • ARM64 • PyPy
runs-on: ubuntu-24.04
env:
BUILD_DIR: "/tmp/ph_build_stuff"
KEY_HEAD: Pi-Heif-aarch64-${{ matrix.cibw_buildlinux }}

steps:
- uses: actions/checkout@v4
- name: Transform to Pi-Heif
run: |
cp -r -v ./pi-heif/* .
python3 .github/transform_to-pi_heif.py
- uses: actions/cache@v4
with:
Expand All @@ -242,8 +340,8 @@ jobs:
python3 -m pip install cibuildwheel==2.21.3
python3 -m cibuildwheel
env:
CIBW_BUILD: ${{ format('pp3*-{0}_{1}', matrix.cibw_buildlinux, matrix.cibw_arch) }}
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BUILD: ${{ format('pp3*-{0}_{1}', matrix.cibw_buildlinux, aarch64) }}
CIBW_ARCHS: "aarch64"
CIBW_BEFORE_ALL_LINUX: |
yum makecache && yum install -y libjpeg-turbo-devel lcms2-devel
python3 {package}/libheif/linux_build_libs.py
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/wheels-pillow_heif.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
python3 -m pip install cibuildwheel==2.21.3
python3 -m cibuildwheel
env:
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, "x86_64") }}
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, x86_64) }}
CIBW_ARCHS: "x86_64"
CIBW_BEFORE_ALL_LINUX: |
${{ env.INSTALL_OS_PACKAGES }}
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
python3 -m pip install cibuildwheel==2.21.3
python3 -m cibuildwheel
env:
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, "aarch64") }}
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, aarch64) }}
CIBW_ARCHS: "aarch64"
CIBW_BEFORE_ALL_LINUX: |
${{ env.INSTALL_OS_PACKAGES }}
Expand Down Expand Up @@ -271,7 +271,7 @@ jobs:
python3 -m pip install cibuildwheel==2.21.3
python3 -m cibuildwheel
env:
CIBW_BUILD: ${{ format('pp3*-{0}_{1}', matrix.cibw_buildlinux, "x86_64") }}
CIBW_BUILD: ${{ format('pp3*-{0}_{1}', matrix.cibw_buildlinux, x86_64) }}
CIBW_ARCHS: "x86_64"
CIBW_BEFORE_ALL_LINUX: |
yum makecache && yum install -y libjpeg-turbo-devel lcms2-devel
Expand Down Expand Up @@ -320,7 +320,7 @@ jobs:
python3 -m pip install cibuildwheel==2.21.3
python3 -m cibuildwheel
env:
CIBW_BUILD: ${{ format('pp3*-{0}_{1}', matrix.cibw_buildlinux, "aarch64") }}
CIBW_BUILD: ${{ format('pp3*-{0}_{1}', matrix.cibw_buildlinux, aarch64) }}
CIBW_ARCHS: "aarch64"
CIBW_BEFORE_ALL_LINUX: |
yum makecache && yum install -y libjpeg-turbo-devel lcms2-devel
Expand Down
2 changes: 1 addition & 1 deletion libheif/linux_build_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from re import IGNORECASE, MULTILINE, match, search
from subprocess import DEVNULL, PIPE, STDOUT, CalledProcessError, TimeoutExpired, run

# 0
# 1
BUILD_DIR = environ.get("BUILD_DIR", "/tmp/ph_build_stuff")
INSTALL_DIR_LIBS = environ.get("INSTALL_DIR_LIBS", "/usr")
PH_LIGHT_VERSION = sys.maxsize <= 2**32 or getenv("PH_LIGHT_ACTION", "0") != "0"
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ dev =
pre-commit
pylint
coverage
setuptools

0 comments on commit 8b47a9c

Please sign in to comment.