Skip to content

Update and rename build-wheels.yml to debug_build-wheels.yml #196

Update and rename build-wheels.yml to debug_build-wheels.yml

Update and rename build-wheels.yml to debug_build-wheels.yml #196

name: Debug 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.os.name }}
runs-on: ${{ matrix.os.runs-on }}
strategy:
fail-fast: false
matrix:
os:
- name: Ubuntu 24+16 i386 CPython 2.7
runs-on: ubuntu-latest
matrix: linux
arch: i386
tag_arch: i686
release: xenial
mirror: http://azure.archive.ubuntu.com/ubuntu
version: 1.5.6.3
pyver: "2.7"
pypkg: python2.7
pyengine_tag: cp27-cp27mu
- name: Ubuntu 24+16 i386 CPython 3.4
runs-on: ubuntu-latest
matrix: linux
arch: i386
tag_arch: i686
release: xenial
mirror: http://azure.archive.ubuntu.com/ubuntu
version: 1.5.6.3
pyver: "3.4"
pypkg: python3.4
pyengine_tag: cp34-cp34m
- name: Ubuntu 24+16 amd64 CPython2.7
runs-on: ubuntu-latest
matrix: linux
arch: amd64
tag_arch: x86_64
release: xenial
mirror: http://azure.archive.ubuntu.com/ubuntu
version: 1.5.6.3
pypkg: python2.7
pyver: "2.7"
pyengine_tag: cp27-cp27mu
- name: Ubuntu 24+16 amd64 CPython3.4
runs-on: ubuntu-latest
matrix: linux
arch: amd64
tag_arch: x86_64
release: xenial
mirror: http://azure.archive.ubuntu.com/ubuntu
version: 1.5.6.3
pypkg: python3.4
pyver: "3.4"
pyengine_tag: cp34-cp34m
- name: Ubuntu 20+16 armhf CPython 2.7
runs-on: ubuntu-20.04
matrix: linux
arch: armhf
release: xenial
mirror: http://ports.ubuntu.com/ubuntu-ports
version: 1.5.6.3
pypkg: python2.7
pyver: "2.7"
pyengine_tag: cp27-cp27mu
- name: Ubuntu 20+16 arm64 CPythoon 2.7
runs-on: ubuntu-20.04
matrix: linux
arch: arm64
release: xenial
mirror: http://ports.ubuntu.com/ubuntu-ports
version: 1.5.6.3
pypkg: python2.7
pyver: "2.7"
pyengine_tag: cp27-cp27mu
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: Update and upgrade Ubuntu 24
if: matrix.os.matrix == 'linux'
run: |
sudo which apt
sudo apt update;
sudo apt purge -y firefox lxd snapd;
sudo apt install -y zram-config;
sudo apt list --upgradable;
sudo apt upgrade -y;
- name: Build source distribution with Ubuntu
if: matrix.os.matrix == 'linux'
run: |
sudo apt install -y devscripts debootstrap qemu-user;
pip install build;
python -m build --sdist --outdir dist .
- name: Debootstrap Ubuntu 16 ${{matrix.os.arch}}
if: matrix.os.matrix == 'linux'
run: |
sudo debootstrap --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}}
- name: Update and Upgrade Ubuntu ${{matrix.os.release}}
if: matrix.os.matrix == 'linux'
run: |
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/mkdir /build_wheel
sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/proc -t proc
sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/dev/pts -t devpts
sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/sys -t sysfs
echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-xenial main" > rusoft-python.list
echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-xenial main" > rusoft-backports.list
echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-xenial main" > rusoft-packages.list
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update
sudo cp -v ./*.list ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/sources.list.d
false && sudo rm -fv ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/trusted.gpg.d/* && sudo rm -fv ./ubuntu-xenial-x86/etc/apt/trusted.gpg
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public.gpg -Orusoft.gpg'
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public-old.gpg -Orusoft-old.gpg'
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A2CE4BCCC50209DD || true'
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt upgrade -y
- name: Pepare dev files
if: matrix.os.matrix == 'linux'
run: |
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y libzstd-dev
- name: Pepare for ${{matrix.os.pypkg}} ${{matrix.os.arch}}
if: matrix.os.matrix == 'linux'
run: |
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y ${{matrix.os.pypkg}}-dev gcc pkg-config
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget https://bootstrap.pypa.io/pip/${{matrix.os.pyver}}/get-pip.py -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true"
- name: Pepare source and build wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}}
if: matrix.os.matrix == 'linux'
run: |
sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/
sudo tar -xvf dist/zstd-${{matrix.os.version}}.tar.gz -C ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/
false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} env
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ZSTD_ASM=1 ZSTD_ASM_BMI2=1 ZSTD_THREADS=1 python${{matrix.os.pyver}} setup.py bdist_wheel clean"
- name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}}
if: matrix.os.matrix == 'linux'
run: |
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && python${{matrix.os.pyver}} setup.py test"
- name: Pepare wheel for upload
if: matrix.os.matrix == 'linux'
run: |
sudo cp -v ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/dist/* ./dist
sudo mv -v ./dist/"zstd-${{matrix.os.version}}-${{matrix.os.pyengine_tag}}-linux_${{matrix.os.tag_arch}}.whl" ./dist/"zstd-${{matrix.os.version}}-${{matrix.os.pyengine_tag}}-manylinux_2_17_${{matrix.os.tag_arch}}.whl"
sudo rm -vf ./dist/*.tar.gz
- name: Build ${{ matrix.os.name }} wheels and test (old)
uses: pypa/[email protected]
if: matrix.cibw.group == 'old'
with:
output-dir: dist
env:
CIBW_BUILD: ${{ matrix.cibw.build }}
# Skip 32-bit builds // NO
# CIBW_SKIP: '*-win32 *_i686'
CIBW_MANYLINUX_I686_IMAGE: manylinux1
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MUSLLINUX_I686_IMAGE: musllinux_1_2
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2
# Only build on x86 and arm64 for linux
CIBW_ARCHS_LINUX: i686 x86_64
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: x86_64
# Skip testing Apple Silicon until there are GH runners
CIBW_TEST_SKIP: '*_arm64 *_universal2:arm64'
CIBW_BEFORE_ALL_MACOS: >
python -m pip install --upgrade pip
# CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.7
CIBW_BUILD_VERBOSITY_MACOS: 0
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 (new)
uses: joerick/[email protected]
if: matrix.cibw.group == 'new'
with:
output-dir: dist
env:
CIBW_BUILD: ${{ matrix.cibw.build }}
# Skip 32-bit builds // NO
# CIBW_SKIP: '*-win32 *_i686'
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_MUSLLINUX_I686_IMAGE: musllinux_1_1
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_1
# Only build on x86 and arm64 for linux
CIBW_ARCHS_LINUX: auto aarch64
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: x86_64 arm64
# Skip testing Apple Silicon until there are GH runners
CIBW_TEST_SKIP: '*_arm64 *_universal2:arm64'
CIBW_BEFORE_ALL_MACOS: >
python -m pip install --upgrade pip
# CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.7
CIBW_BUILD_VERBOSITY_MACOS: 0
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
#. path: ./dist
# compression-level: 0
- 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
- 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/*'