Skip to content

Issue 301 initialize compress2 context only once #2576

Issue 301 initialize compress2 context only once

Issue 301 initialize compress2 context only once #2576

Workflow file for this run

name: Build wheels
on: [push, pull_request]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.sha || '' }}
cancel-in-progress: true
jobs:
build_wheels:
name: Build wheel - ${{ matrix.cibw.build }} ${{ matrix.os.name }}
runs-on: ${{ matrix.os.runs-on }}
strategy:
fail-fast: false
matrix:
os:
- name: macOS old
runs-on: macos-15-intel # x86
matrix: macos
- name: macOS Latest
runs-on: macos-latest # arm
matrix: macos
- name: Ubuntu 24.04
runs-on: ubuntu-latest
matrix: linux
- name: Windows
runs-on: windows-latest
matrix: windows
- name: Windows (arm64)
runs-on: windows-11-arm
matrix: windows-arm
cibw:
# build just supported python versions at May 2023
- build: cp27-*
version: v1
code: CPython2.7
manylinux: manylinux1
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64
- build: cp35-*
version: v1
code: CPython3.5
manylinux: manylinux1
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64
- build: cp36-*
version: v1
code: CPython3.6
manylinux: manylinux1
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64
- build: pp27-*
version: v1
code: PyPy2.7
manylinux: manylinux1
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64
- build: pp36-*
version: v1
code: PyPy3.6
manylinux: manylinux1
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64
- build: cp37-*
version: v2
code: CPython3.7
manylinux: manylinux_2_24
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64 arm64
- build: cp38-*
version: v2
code: CPython3.8
manylinux: manylinux_2_24
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64 arm64
- build: cp39-*
version: v2
code: CPython3.9
manylinux: manylinux_2_24
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64 arm64
- build: cp310-*
version: v2
code: CPython3.10
manylinux: manylinux_2_24
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64 arm64
- build: cp311-*
version: v2
code: CPython3.11
manylinux: manylinux_2_24
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64 arm64
- build: cp312-*
version: v2
code: CPython3.12
manylinux: manylinux_2_28
musllinux: musllinux_1_2
archs:
linux: x86_64 aarch64
macos: x86_64 arm64
- build: cp313-*
version: v2
code: CPython3.13
manylinux: manylinux_2_28
musllinux: musllinux_1_2
archs:
linux: x86_64 aarch64
macos: x86_64 arm64
- build: cp314-*
version: v3
code: CPython3.14
manylinux: manylinux_2_28
musllinux: musllinux_1_2
archs:
linux: x86_64 aarch64
macos: x86_64 arm64
- build: pp27-*
version: v1
code: PyPy2.7
manylinux: manylinux1
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64
- build: pp37-*
version: v2
code: PyPy3.7
manylinux: manylinux_2_24
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64 arm64
- build: pp38-*
version: v2
code: PyPy3.8
manylinux: manylinux_2_24
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64 arm64
- build: pp39-*
version: v2
code: PyPy3.9
manylinux: manylinux_2_24
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64 arm64
- build: pp310-*
version: v3
code: PyPy3.10
manylinux: manylinux_2_28
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64 arm64
- build: pp311-*
version: v3
code: PyPy3.11
manylinux: manylinux_2_28
musllinux: musllinux_1_2
archs:
linux: i686 x86_64 aarch64
macos: x86_64 arm64
exclude:
- os:
matrix: windows
cibw:
build: cp27-*
- os:
matrix: macos
cibw:
build: pp27-*
- os:
matrix: macos
cibw:
build: pp36-*
- os:
matrix: macos
cibw:
build: cp35-*
- os:
matrix: windows
cibw:
build: pp27-*
- os:
matrix: windows-arm
cibw:
build: pp27-*
- os:
matrix: windows-arm
cibw:
build: cp27-*
- os:
matrix: windows-arm
cibw:
build: cp35-*
- os:
matrix: windows-arm
cibw:
build: cp36-*
- os:
matrix: windows-arm
cibw:
build: pp36-*
- os:
matrix: windows-arm
cibw:
build: cp37-*
- os:
matrix: windows-arm
cibw:
build: pp37-*
- os:
matrix: windows-arm
cibw:
build: cp38-*
- os:
matrix: windows-arm
cibw:
build: pp38-*
- os:
matrix: windows-arm
cibw:
build: pp39-*
- os:
matrix: windows-arm
cibw:
build: pp310-*
- os:
matrix: windows-arm
cibw:
build: pp311-*
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.12'
- name: Prepare python
run: |
python -m pip install --upgrade pip
- name: Set up QEMU
if: matrix.os.matrix == 'linux'
uses: docker/setup-qemu-action@v1
with:
platforms: 'arm64'
- name: Build source distribution with Ubuntu
if: matrix.os.matrix == 'linux'
run: |
echo OS-RELEASE; cat /etc/os-release;
echo CPU-FLAGS; grep flags /proc/cpuinfo
sudo apt purge -y firefox snapd;
false && sudo apt update; apt list --upgradable; false && sudo apt upgrade -y;
sudo apt install -y libzstd-dev;
echo PKG-CONFIG;
which pkg-config;
pkg-config libzstd --modversion;
echo PIP-BUILD;
pip install build;
python -m build --sdist --outdir dist .
- name: Build ${{ matrix.os.name }} wheels and test (v1)
uses: pypa/cibuildwheel@v1.12.0
if: matrix.cibw.version == 'v1'
with:
output-dir: dist
env:
CIBW_BUILD: ${{ matrix.cibw.build }}
CIBW_BUILD_VERBOSITY: 2
# Skip 32-bit builds // NO
# CIBW_SKIP: '*-win32 *_i686'
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.cibw.manylinux }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.cibw.manylinux }}
CIBW_MUSLLINUX_I686_IMAGE: ${{ matrix.cibw.musllinux }}
CIBW_MUSLLINUX_X86_64_IMAGE: ${{ matrix.cibw.musllinux }}
# Only build on x86 and arm64 for linux
CIBW_ARCHS_LINUX: ${{ matrix.cibw.archs.linux }}
CIBW_BEFORE_ALL_LINUX: >
python -m pip install --upgrade pip;
# CIBW_ARCHS_MACOS: x86_64 arm64 universal2
# Building two wheels for MacOS and skipping Universal
CIBW_ARCHS_MACOS: ${{ matrix.cibw.archs.macos }}
# Skip testing Apple Silicon until there are GH runners
CIBW_TEST_SKIP: '*macosx_arm64 *_universal2:arm64'
CIBW_BEFORE_ALL_MACOS: >
python -m pip install --upgrade pip
# CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.7
CIBW_BEFORE_ALL_WINDOWS: >
python -m pip install --upgrade pip
CIBW_TEST_COMMAND: >
python -m unittest discover -v -s {package}
- name: Build ${{ matrix.os.name }} wheels and test (v2)
uses: joerick/cibuildwheel@v2.23.3
if: matrix.cibw.version == 'v2'
with:
output-dir: dist
env:
CIBW_ENABLE: pypy
CIBW_BUILD: ${{ matrix.cibw.build }}
CIBW_BUILD_VERBOSITY: 2
# Skip 32-bit builds // NO
# CIBW_SKIP: '*-win32 *_i686'
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.cibw.manylinux }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.cibw.manylinux }}
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.cibw.manylinux }}
CIBW_MUSLLINUX_I686_IMAGE: ${{ matrix.cibw.musllinux }}
CIBW_MUSLLINUX_X86_64_IMAGE: ${{ matrix.cibw.musllinux }}
# Only build on x86 and arm64 for linux
CIBW_ARCHS_LINUX: ${{ matrix.cibw.archs.linux }}
CIBW_BEFORE_ALL_LINUX: >
python -m pip install --upgrade pip
# CIBW_ARCHS_MACOS: x86_64 arm64 universal2
# Building two wheels for MacOS and skipping Universal
CIBW_ARCHS_MACOS: ${{ matrix.cibw.archs.macos }}
# Skip testing Apple Silicon until there are GH runners
CIBW_TEST_SKIP: '*macosx_arm64 *_universal2:arm64'
CIBW_BEFORE_ALL_MACOS: >
python -m pip install --upgrade pip
# CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.7
CIBW_BEFORE_ALL_WINDOWS: >
python -m pip install --upgrade pip
CIBW_TEST_COMMAND: >
python -m unittest discover -v -s {package}
- name: Build ${{ matrix.os.name }} wheels and test (v3)
uses: joerick/cibuildwheel@v3.2.1
if: matrix.cibw.version == 'v3'
with:
output-dir: dist
env:
CIBW_ENABLE: pypy pypy-eol
CIBW_BUILD: ${{ matrix.cibw.build }}
CIBW_BUILD_VERBOSITY: 2
# Skip 32-bit builds // NO
# CIBW_SKIP: '*-win32 *_i686'
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.cibw.manylinux }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.cibw.manylinux }}
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.cibw.manylinux }}
CIBW_MUSLLINUX_I686_IMAGE: ${{ matrix.cibw.musllinux }}
CIBW_MUSLLINUX_X86_64_IMAGE: ${{ matrix.cibw.musllinux }}
# Only build on x86 and arm64 for linux
CIBW_ARCHS_LINUX: ${{ matrix.cibw.archs.linux }}
CIBW_BEFORE_ALL_LINUX: >
python -m pip install --upgrade pip
# CIBW_ARCHS_MACOS: x86_64 arm64 universal2
# Building two wheels for MacOS and skipping Universal
CIBW_ARCHS_MACOS: ${{ matrix.cibw.archs.macos }}
# Skip testing Apple Silicon until there are GH runners
CIBW_TEST_SKIP: '*macosx_arm64 *_universal2:arm64'
CIBW_BEFORE_ALL_MACOS: >
python -m pip install --upgrade pip
# CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.7
CIBW_BEFORE_ALL_WINDOWS: >
python -m pip install --upgrade pip
CIBW_TEST_COMMAND: >
python -m unittest discover -v -s {package}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-v4-${{matrix.os.matrix}}-${{matrix.cibw.code}}-${{matrix.cibw.version}}
path: ./dist
overwrite: true
- name: Test for secrets access
id: check_secrets
# If a third party makes a pull request
# this allows automated steps below to be skipped
# and leave a clean PR CI run
shell: bash
run: |
unset HAS_SECRET
unset HAS_SECRET_TEST
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
if [ -n "$SECRET_TEST" ]; then HAS_SECRET_TEST='true' ; fi
echo ::set-output name=HAS_SECRET::${HAS_SECRET}
echo ::set-output name=HAS_SECRET_TEST::${HAS_SECRET_TEST}
env:
SECRET: "${{ secrets.pypi_password }}"
SECRET_TEST: "${{ secrets.test_pypi_password }}"
- name: Install twine
run: pip install twine==6.0.1
- name: Publish distribution to PyPI
if: >
startsWith(github.event.ref, 'refs/tags') &&
steps.check_secrets.outputs.HAS_SECRET
env:
# If the PR/Push has secret access
# and PYPI_PASSWORD is in GH Secrets for this repo
# and this is a tag, publish to PyPI
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
TWINE_USERNAME: "${{ secrets.pypi_username }}"
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: "${{ secrets.pypi_password }}"
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'
- name: Publish distribution to Test PyPI
if: steps.check_secrets.outputs.HAS_SECRET
env:
# If the PR/Push has secret access
# and TEST_PYPI_PASSWORD is in GH Secrets for this repo
# then publish each build to test PyPI
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
TWINE_USERNAME: "${{ secrets.test_pypi_username }}"
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: "${{ secrets.test_pypi_password }}"
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'