diff --git a/.github/workflows/Build_wheels_for_cpython27_armhf.yml b/.github/workflows/Build_wheels_for_cpython27_armhf.yml new file mode 100644 index 000000000..abfcb9c17 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython27_armhf.yml @@ -0,0 +1,171 @@ +name: Build wheels for CPython2.7 armhf + +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+18 i386 CPython 2.7 + runs-on: ubuntu-latest + matrix: linux + arch: armhf + tag_arch: armhf + release: bionic + mirror: http://ports.ubuntu.com/ubuntu-ports + version: 1.5.6.3 + # pyver: "2.7" + getpipurl: https://bootstrap.pypa.io/pip/2.7/get-pip.py + pypkg: python2.7 + pyengine_tag: cp27-cp27mu + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - name: Build source distribution with Ubuntu + if: matrix.os.matrix == 'linux' + run: | + sudo apt install -y debootstrap qemu-user; + pip install build; + python -m build --sdist --outdir dist . + + - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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 + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} setup.py bdist_wheel " + + - 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}} find /build_wheel/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/ && ldd /zstd-${{matrix.os.version}}/build/*/zstd.so" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ${{matrix.os.pypkg}} 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + +# - 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<=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/*' diff --git a/.github/workflows/Build_wheels_for_cpython27_x86.yml b/.github/workflows/Build_wheels_for_cpython27_x86.yml new file mode 100644 index 000000000..95461fbe6 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython27_x86.yml @@ -0,0 +1,172 @@ +name: Build wheels for CPython2.7 x86 + +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" + getpipurl: https://bootstrap.pypa.io/pip/2.7/get-pip.py + pypkg: python2.7 + pyengine_tag: cp27-cp27mu + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - 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 ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ZSTD_ASM=1 _ZSTD_SMALL=1 _ZSTD_ASM_BMI2=1 ZSTD_THREADS=1 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} setup.py bdist_wheel " + + - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/ ; echo LLH; ls -lh build/*/zstd.so; echo LDD; ldd build/*/zstd.so;echo FILE; file build/*/zstd.so; echo LIBC; bash ./glibc-check.sh build/*/zstd.so" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ${{matrix.os.pypkg}} 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + +# - 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<=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/*' diff --git a/.github/workflows/Build_wheels_for_cpython27_x86_64.yml b/.github/workflows/Build_wheels_for_cpython27_x86_64.yml new file mode 100644 index 000000000..70ccbf5b4 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython27_x86_64.yml @@ -0,0 +1,172 @@ +name: Build wheels for CPython2.7 x86_64 + +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 amd64 CPython 2.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 + pyver: "2.7" + getpipurl: https://bootstrap.pypa.io/pip/2.7/get-pip.py + pypkg: python2.7 + pyengine_tag: cp27-cp27mu + libc_tag: manylinux_2_17 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - 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 ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 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: | + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/ ls -lh build/*/zstd.*so; ldd build/*/zstd.*so ; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*so" + 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' diff --git a/.github/workflows/Build_wheels_for_cpython310_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython310_x86_64_u24.yml new file mode 100644 index 000000000..a6a4864d7 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython310_x86_64_u24.yml @@ -0,0 +1,175 @@ +name: Build wheels for CPython3.10 x86_64 on Ubuntu24 + +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 amd64 CPython 3.10 + runs-on: ubuntu-latest + matrix: linux + arch: amd64 + tag_arch: x86_64 + release: noble + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + # pyver: "3.7" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.10 + pypkgadd: python3.10-distutils + pyengine_tag: cp310-cp310 + libc_tag: manylinux_2_34 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - name: Build source distribution with Ubuntu + if: matrix.os.matrix == 'linux' + run: | + sudo apt install -y debootstrap qemu-user; + pip install build; + python -m build --sdist --outdir dist . + + - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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 + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 file + + - 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} setup.py bdist_wheel" + + - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/; echo LLH; ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so ; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so" + + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ${{matrix.os.pypkg}} 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython310_x86_u16.yml b/.github/workflows/Build_wheels_for_cpython310_x86_u16.yml new file mode 100644 index 000000000..8a9679cce --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython310_x86_u16.yml @@ -0,0 +1,176 @@ +name: Build wheels for CPython3.10 x86 on Ubuntu16 + +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 3.10 + 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.10" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.10 + pypkgadd: python3.10-distutils + pyengine_tag: cp310-cp310 + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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 dist-upgrade -y; + sudo apt install -f + + - 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 ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,gnupg,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt dist-upgrade -y + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U pkginfo" + + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 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}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/ ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so" + 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython311_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython311_x86_64_u24.yml new file mode 100644 index 000000000..15a50a33f --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython311_x86_64_u24.yml @@ -0,0 +1,175 @@ +name: Build wheels for CPython3.11 x86_64 on Ubuntu24 + +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 amd64 CPython 3.11 + runs-on: ubuntu-latest + matrix: linux + arch: amd64 + tag_arch: x86_64 + release: noble + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + # pyver: "3.7" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.11 + pypkgadd: python3.11-distutils + pyengine_tag: cp311-cp311 + libc_tag: manylinux_2_34 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - name: Build source distribution with Ubuntu + if: matrix.os.matrix == 'linux' + run: | + sudo apt install -y debootstrap qemu-user; + pip install build; + python -m build --sdist --outdir dist . + + - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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 + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 file + + - 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} setup.py bdist_wheel" + + - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/; echo LLH; ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so ; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so" + + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ${{matrix.os.pypkg}} 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython311_x86_u16.yml b/.github/workflows/Build_wheels_for_cpython311_x86_u16.yml new file mode 100644 index 000000000..bdb22b69a --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython311_x86_u16.yml @@ -0,0 +1,176 @@ +name: Build wheels for CPython3.11 x86 on Ubuntu16 + +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 3.11 + 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.11" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.11 + pypkgadd: python3.11-distutils + pyengine_tag: cp311-cp311 + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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 dist-upgrade -y; + sudo apt install -f + + - 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 ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,gnupg,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt dist-upgrade -y + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U pkginfo" + + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 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}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/ ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so" + 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython312_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython312_x86_64_u24.yml new file mode 100644 index 000000000..08065c23f --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython312_x86_64_u24.yml @@ -0,0 +1,175 @@ +name: Build wheels for CPython3.12 x86_64 on Ubuntu24 + +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 amd64 CPython 3.12 + runs-on: ubuntu-latest + matrix: linux + arch: amd64 + tag_arch: x86_64 + release: noble + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + # pyver: "3.7" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.12 + pypkgadd: python3.12-distutils + pyengine_tag: cp312-cp312 + libc_tag: manylinux_2_34 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - name: Build source distribution with Ubuntu + if: matrix.os.matrix == 'linux' + run: | + sudo apt install -y debootstrap qemu-user; + pip install build; + python -m build --sdist --outdir dist . + + - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 file + + - 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} setup.py bdist_wheel" + + - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/; echo LLH; ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so ; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so" + + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ${{matrix.os.pypkg}} 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython312_x86_u16.yml b/.github/workflows/Build_wheels_for_cpython312_x86_u16.yml new file mode 100644 index 000000000..d4283cc64 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython312_x86_u16.yml @@ -0,0 +1,175 @@ +name: Build wheels for CPython3.12 x86 on Ubuntu16 + +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 3.12 + 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.12" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.12 + #pypkgadd: python3.12-distutils + pyengine_tag: cp312-cp312 + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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 dist-upgrade -y; + sudo apt install -f + + - name: Build source distribution with Ubuntu + if: matrix.os.matrix == 'linux' + run: | + sudo apt install -y debootstrap qemu-user; + pip install build; + python -m build --sdist --outdir dist . + + - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,gnupg,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + false && echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt dist-upgrade -y + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U pkginfo" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} setup.py bdist_wheel " + + - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/ ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ${{matrix.os.pypkg}} 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython313_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython313_x86_64_u24.yml new file mode 100644 index 000000000..6d172c78b --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython313_x86_64_u24.yml @@ -0,0 +1,175 @@ +name: Build wheels for CPython3.13 x86_64 on Ubuntu24 + +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 amd64 CPython 3.13 + runs-on: ubuntu-latest + matrix: linux + arch: amd64 + tag_arch: x86_64 + release: noble + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + # pyver: "3.7" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.13 + #pypkgadd: python3.13-distutils + pyengine_tag: cp313-cp313 + libc_tag: manylinux_2_34 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - name: Build source distribution with Ubuntu + if: matrix.os.matrix == 'linux' + run: | + sudo apt install -y debootstrap qemu-user; + pip install build; + python -m build --sdist --outdir dist . + + - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 file + + - 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} setup.py bdist_wheel" + + - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/; echo LLH; ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so ; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so" + + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ${{matrix.os.pypkg}} 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython314_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython314_x86_64_u24.yml new file mode 100644 index 000000000..0661f592a --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython314_x86_64_u24.yml @@ -0,0 +1,175 @@ +name: Build wheels for CPython3.14 x86_64 on Ubuntu24 + +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 amd64 CPython 3.14 + runs-on: ubuntu-latest + matrix: linux + arch: amd64 + tag_arch: x86_64 + release: noble + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + # pyver: "3.7" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.14 + #pypkgadd: python3.13-distutils + pyengine_tag: cp314-cp314 + libc_tag: manylinux_2_34 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - name: Build source distribution with Ubuntu + if: matrix.os.matrix == 'linux' + run: | + sudo apt install -y debootstrap qemu-user; + pip install build; + python -m build --sdist --outdir dist . + + - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 file + + - 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} setup.py bdist_wheel" + + - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/; echo LLH; ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so ; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so" + + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ${{matrix.os.pypkg}} 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython34_x86.yml b/.github/workflows/Build_wheels_for_cpython34_x86.yml new file mode 100644 index 000000000..acf274643 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython34_x86.yml @@ -0,0 +1,236 @@ +name: Build wheels for CPython3.4 x86 + +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 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" + getpipurl: https://bootstrap.pypa.io/pip/3.4/get-pip.py + pypkg: python3.4 + pyengine_tag: cp34-cp34m + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - 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 ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 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}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/ ls -lh build/*/zstd.*so; ldd build/*/zstd.*so ; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*so" + + 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + - name: Build ${{ matrix.os.name }} wheels and test (old) + uses: pypa/cibuildwheel@v1.12.0 + 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/cibuildwheel@v2.22.0 + 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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython34_x86_64.yml b/.github/workflows/Build_wheels_for_cpython34_x86_64.yml new file mode 100644 index 000000000..74aad8019 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython34_x86_64.yml @@ -0,0 +1,235 @@ +name: Build wheels for CPython3.4 x86_64 + +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 amd64 CPython 3.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 + pyver: "3.4" + getpipurl: https://bootstrap.pypa.io/pip/3.4/get-pip.py + pypkg: python3.4 + pyengine_tag: cp34-cp34m + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - 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 ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 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}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/ ls -lh build/*/zstd.*so; ldd build/*/zstd.*so ; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*so" + 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + - name: Build ${{ matrix.os.name }} wheels and test (old) + uses: pypa/cibuildwheel@v1.12.0 + 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/cibuildwheel@v2.22.0 + 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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython35_x86.yml b/.github/workflows/Build_wheels_for_cpython35_x86.yml new file mode 100644 index 000000000..e77005960 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython35_x86.yml @@ -0,0 +1,232 @@ +name: Build wheels for CPython3.5 x86 + +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 3.5 + 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.5" + getpipurl: https://bootstrap.pypa.io/pip/3.5/get-pip.py + pypkg: python3.5 + pyengine_tag: cp35-cp35m + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - 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 ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + - name: Build ${{ matrix.os.name }} wheels and test (old) + uses: pypa/cibuildwheel@v1.12.0 + 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/cibuildwheel@v2.22.0 + 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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython35_x86_64.yml b/.github/workflows/Build_wheels_for_cpython35_x86_64.yml new file mode 100644 index 000000000..b770805d3 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython35_x86_64.yml @@ -0,0 +1,232 @@ +name: Build wheels for CPython3.5 x86_64 + +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 amd64 CPython 3.5 + 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 + pyver: "3.5" + getpipurl: https://bootstrap.pypa.io/pip/3.5/get-pip.py + pypkg: python3.5 + pyengine_tag: cp35-cp35m + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - 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 ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + - name: Build ${{ matrix.os.name }} wheels and test (old) + uses: pypa/cibuildwheel@v1.12.0 + 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/cibuildwheel@v2.22.0 + 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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython36_x86.yml b/.github/workflows/Build_wheels_for_cpython36_x86.yml new file mode 100644 index 000000000..3560d8db7 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython36_x86.yml @@ -0,0 +1,173 @@ +name: Build wheels for CPython3.6 x86 + +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 3.6 + 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.6" + getpipurl: https://bootstrap.pypa.io/pip/3.6/get-pip.py + pypkg: python3.6 + pypkgadd: python3.6-distutils + pyengine_tag: cp36-cp36m + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - 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 ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U pkginfo" + + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} 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}} && ${{matrix.os.pypkg}} 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython36_x86_64.yml b/.github/workflows/Build_wheels_for_cpython36_x86_64.yml new file mode 100644 index 000000000..8385eb21d --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython36_x86_64.yml @@ -0,0 +1,171 @@ +name: Build wheels for CPython3.6 x86_64 + +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 amd64 CPython 3.6 + 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 + pyver: "3.6" + getpipurl: https://bootstrap.pypa.io/pip/3.6/get-pip.py + pypkg: python3.6 + pypkgadd: python3.6-distutils + pyengine_tag: cp36-cp36m + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - 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 ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython37_x86.yml b/.github/workflows/Build_wheels_for_cpython37_x86.yml new file mode 100644 index 000000000..ddb4df430 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython37_x86.yml @@ -0,0 +1,176 @@ +name: Build wheels for CPython3.7 x86 on Ububntu16 + +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 3.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: "3.11" + getpipurl: https://bootstrap.pypa.io/pip/3.7/get-pip.py + pypkg: python3.7 + pypkgadd: python3.7-distutils + pyengine_tag: cp37-cp37 + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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 dist-upgrade -y; + sudo apt install -f + + - 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 ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,gnupg,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt dist-upgrade -y + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U pkginfo" + + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 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}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/ ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so" + 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython37_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython37_x86_64_u24.yml new file mode 100644 index 000000000..87e684f65 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython37_x86_64_u24.yml @@ -0,0 +1,175 @@ +name: Build wheels for CPython3.7 x86_64 on Ubuntu24 + +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 amd64 CPython 3.7 + runs-on: ubuntu-latest + matrix: linux + arch: amd64 + tag_arch: x86_64 + release: noble + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + # pyver: "3.7" + getpipurl: https://bootstrap.pypa.io/pip/3.7/get-pip.py + pypkg: python3.7 + pypkgadd: python3.7-distutils + pyengine_tag: cp37-cp37m + libc_tag: manylinux_2_34 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - name: Build source distribution with Ubuntu + if: matrix.os.matrix == 'linux' + run: | + sudo apt install -y debootstrap qemu-user; + pip install build; + python -m build --sdist --outdir dist . + + - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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 + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} setup.py bdist_wheel" + + - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/; echo LLH; ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so ; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so" + + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ${{matrix.os.pypkg}} 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython38_x86.yml b/.github/workflows/Build_wheels_for_cpython38_x86.yml new file mode 100644 index 000000000..4ded8cf5b --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython38_x86.yml @@ -0,0 +1,173 @@ +name: Build wheels for CPython3.8 x86 + +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 3.8 + 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.8" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.8 + pypkgadd: python3.8-distutils + pyengine_tag: cp38-cp38 + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - 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 ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U pkginfo" + + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/Build_wheels_for_cpython38_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython38_x86_64_u24.yml new file mode 100644 index 000000000..338e9e298 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython38_x86_64_u24.yml @@ -0,0 +1,175 @@ +name: Build wheels for CPython3.8 x86_64 on Ubuntu24 + +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 amd64 CPython 3.8 + runs-on: ubuntu-latest + matrix: linux + arch: amd64 + tag_arch: x86_64 + release: noble + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + # pyver: "3.7" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.8 + pypkgadd: python3.8-distutils + pyengine_tag: cp38-cp38 + libc_tag: manylinux_2_34 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - name: Build source distribution with Ubuntu + if: matrix.os.matrix == 'linux' + run: | + sudo apt install -y debootstrap qemu-user; + pip install build; + python -m build --sdist --outdir dist . + + - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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 + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} setup.py bdist_wheel" + + - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/; echo LLH; ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so ; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so" + + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ${{matrix.os.pypkg}} 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/Build_wheels_for_cpython39_x86.yml b/.github/workflows/Build_wheels_for_cpython39_x86.yml similarity index 99% rename from Build_wheels_for_cpython39_x86.yml rename to .github/workflows/Build_wheels_for_cpython39_x86.yml index 9d20c280b..b0cef5d06 100644 --- a/Build_wheels_for_cpython39_x86.yml +++ b/.github/workflows/Build_wheels_for_cpython39_x86.yml @@ -27,7 +27,7 @@ jobs: pypkg: python3.9 pypkgadd: python3.9-distutils pyengine_tag: cp39-cp39 - libc_tag: manylinux_2_17 + libc_tag: manylinux_2_4 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/Build_wheels_for_cpython39_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython39_x86_64_u24.yml new file mode 100644 index 000000000..820b52b16 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython39_x86_64_u24.yml @@ -0,0 +1,175 @@ +name: Build wheels for CPython3.9 x86_64 on Ubuntu24 + +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 amd64 CPython 3.9 + runs-on: ubuntu-latest + matrix: linux + arch: amd64 + tag_arch: x86_64 + release: noble + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + # pyver: "3.7" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.9 + pypkgadd: python3.9-distutils + pyengine_tag: cp39-cp39 + libc_tag: manylinux_2_34 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - 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; + sudo apt install -f + + - name: Build source distribution with Ubuntu + if: matrix.os.matrix == 'linux' + run: | + sudo apt install -y debootstrap qemu-user; + pip install build; + python -m build --sdist --outdir dist . + + - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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 + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + 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 file + + - 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 ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" + + - 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}} pkg-config libzstd --modversion + 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 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} setup.py bdist_wheel" + + - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/; echo LLH; ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so ; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so" + + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ${{matrix.os.pypkg}} 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + sudo rm -vf ./dist/*.tar.gz + + +# - 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<=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/*' + diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 9f99d146f..05d1a5507 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -20,9 +20,12 @@ jobs: - name: macOS Latest runs-on: macos-latest # arm matrix: macos - - name: Linux + - name: Ubuntu 24.04 runs-on: ubuntu-latest matrix: linux + - name: Ubuntu 20.04 + runs-on: ubuntu-20 + matrix: linux - name: Windows runs-on: windows-latest matrix: windows @@ -108,7 +111,16 @@ jobs: - name: Build source distribution with Ubuntu if: matrix.os.matrix == 'linux' run: | - pip install build + echo OS-RELEASE; cat /etc/os-release; + echo CPU-FLAGS; grep flags /proc/cpuinfo + sudo apt purge -y firefox snapd; + sudo apt update; apt list --upgradable; 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 (old) @@ -118,6 +130,7 @@ jobs: output-dir: dist env: CIBW_BUILD: ${{ matrix.cibw.build }} + CIBW_BUILD_VERBOSITY_LINUX: 1 # Skip 32-bit builds // NO # CIBW_SKIP: '*-win32 *_i686' CIBW_MANYLINUX_I686_IMAGE: manylinux1 @@ -127,7 +140,7 @@ jobs: # Only build on x86 and arm64 for linux CIBW_ARCHS_LINUX: i686 x86_64 CIBW_BEFORE_ALL_LINUX: > - python -m pip install --upgrade pip + 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 @@ -149,13 +162,14 @@ jobs: output-dir: dist env: CIBW_BUILD: ${{ matrix.cibw.build }} + CIBW_BUILD_VERBOSITY_LINUX: 1 # 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 + CIBW_MANYLINUX_I686_IMAGE: manylinux_2_24 + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_24 + 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: auto aarch64 CIBW_BEFORE_ALL_LINUX: > @@ -175,7 +189,7 @@ jobs: python -m unittest discover -v -s {package} - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.6.0 with: name: wheels path: ./dist diff --git a/.github/workflows/debug_build-wheels.yml b/.github/workflows/debug_build-wheels.yml index 3abf19b9c..57d48552b 100644 --- a/.github/workflows/debug_build-wheels.yml +++ b/.github/workflows/debug_build-wheels.yml @@ -1,4 +1,4 @@ -name: Debug build wheels +name: Build wheels w/o cibw on: [push, pull_request] @@ -26,6 +26,7 @@ jobs: getpipurl: https://bootstrap.pypa.io/pip/2.7/get-pip.py pypkg: python2.7 pyengine_tag: cp27-cp27mu + libc_tag: manylinux_2_17 - name: Ubuntu 24+16 i386 CPython 3.4 runs-on: ubuntu-latest matrix: linux @@ -38,6 +39,7 @@ jobs: getpipurl: https://bootstrap.pypa.io/pip/3.4/get-pip.py pypkg: python3.4 pyengine_tag: cp34-cp34m + libc_tag: manylinux_2_17 - name: Ubuntu 24+16 i386 CPython 3.5 runs-on: ubuntu-latest matrix: linux @@ -50,6 +52,7 @@ jobs: getpipurl: https://bootstrap.pypa.io/pip/3.5/get-pip.py pypkg: python3.5 pyengine_tag: cp35-cp35m + libc_tag: manylinux_2_17 - name: Ubuntu 24+16 i386 CPython 3.6 runs-on: ubuntu-latest matrix: linux @@ -63,6 +66,7 @@ jobs: pypkg: python3.6 pypkgadd: python3.6-distutils pyengine_tag: cp36-cp36m + libc_tag: manylinux_2_17 - name: Ubuntu 24+16 i386 CPython 3.7 runs-on: ubuntu-latest matrix: linux @@ -76,6 +80,7 @@ jobs: pypkg: python3.7 pypkgadd: python3.7-distutils pyengine_tag: cp37-cp37m + libc_tag: manylinux_2_17 - name: Ubuntu 24+16 i386 CPython 3.8 runs-on: ubuntu-latest matrix: linux @@ -88,7 +93,50 @@ jobs: getpipurl: https://bootstrap.pypa.io/pip/get-pip.py pypkg: python3.8 pypkgadd: python3.8-distutils - pyengine_tag: cp38-cp38m + pyengine_tag: cp38-cp38 + libc_tag: manylinux_2_17 + - name: Ubuntu 24+16 i386 CPython 3.9 + 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.9" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.9 + pypkgadd: python3.9-distutils + pyengine_tag: cp39-cp39 + libc_tag: manylinux_2_17 + - name: Ubuntu 24+20 i386 CPython 3.10 + runs-on: ubuntu-latest + matrix: linux + arch: i386 + tag_arch: i686 + release: focal + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + pyver: "3.10" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.10 + pypkgadd: python3.10-distutils + pyengine_tag: cp310-cp310 + libc_tag: manylinux_2_19 + - name: Ubuntu 24+20 i386 CPython 3.11 + runs-on: ubuntu-latest + matrix: linux + arch: i386 + tag_arch: i686 + release: focal + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + pyver: "3.11" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.11 + pypkgadd: python3.11-distutils + pyengine_tag: cp311-cp311 + libc_tag: manylinux_2_19 - name: Ubuntu 24+16 amd64 CPython2.7 runs-on: ubuntu-latest matrix: linux @@ -101,6 +149,7 @@ jobs: pyver: "2.7" getpipurl: https://bootstrap.pypa.io/pip/2.7/get-pip.py pyengine_tag: cp27-cp27mu + libc_tag: manylinux_2_17 - name: Ubuntu 24+16 amd64 CPython3.4 runs-on: ubuntu-latest matrix: linux @@ -113,6 +162,7 @@ jobs: pyver: "3.4" getpipurl: https://bootstrap.pypa.io/pip/3.4/get-pip.py pyengine_tag: cp34-cp34m + libc_tag: manylinux_2_17 - name: Ubuntu 24+16 amd64 CPython3.5 runs-on: ubuntu-latest matrix: linux @@ -125,6 +175,7 @@ jobs: pyver: "3.5" getpipurl: https://bootstrap.pypa.io/pip/3.5/get-pip.py pyengine_tag: cp35-cp35m + libc_tag: manylinux_2_17 - name: Ubuntu 24+16 amd64 CPython3.6 runs-on: ubuntu-latest matrix: linux @@ -138,6 +189,7 @@ jobs: pyver: "3.6" getpipurl: https://bootstrap.pypa.io/pip/3.6/get-pip.py pyengine_tag: cp36-cp36m + libc_tag: manylinux_2_17 - name: Ubuntu 24+16 amd64 CPython3.7 runs-on: ubuntu-latest matrix: linux @@ -151,6 +203,7 @@ jobs: pyver: "3.7" getpipurl: https://bootstrap.pypa.io/pip/3.7/get-pip.py pyengine_tag: cp37-cp37m + libc_tag: manylinux_2_17 - name: Ubuntu 24+16 amd64 CPython3.8 runs-on: ubuntu-latest matrix: linux @@ -163,29 +216,74 @@ jobs: pypkgadd: python3.8-distutils pyver: "3.8" getpipurl: https://bootstrap.pypa.io/pip/get-pip.py - pyengine_tag: cp38-cp38m - - name: Ubuntu 24+16 armhf CPython 2.7 + pyengine_tag: cp38-cp38 + libc_tag: manylinux_2_17 + - name: Ubuntu 24+16 amd64 CPython3.9 runs-on: ubuntu-latest matrix: linux - arch: armhf + arch: amd64 + tag_arch: x86_64 release: xenial + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + pypkg: python3.9 + pypkgadd: python3.9-distutils + pyver: "3.9" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pyengine_tag: cp39-cp39 + libc_tag: manylinux_2_17 + - name: Ubuntu 24+20 amd64 CPython3.10 + runs-on: ubuntu-latest + matrix: linux + arch: amd64 + tag_arch: x86_64 + release: focal + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + pypkg: python3.10 + pypkgadd: python3.10-distutils + pyver: "3.10" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pyengine_tag: cp310-cp310 + libc_tag: manylinux_2_19 + - name: Ubuntu 24+20 amd64 CPython3.11 + runs-on: ubuntu-latest + matrix: linux + arch: amd64 + tag_arch: x86_64 + release: focal + mirror: http://azure.archive.ubuntu.com/ubuntu + version: 1.5.6.3 + pypkg: python3.11 + pypkgadd: python3.11-distutils + pyver: "3.11" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pyengine_tag: cp311-cp311 + libc_tag: manylinux_2_19 + - name: Ubuntu 24+18 armhf CPython 2.7 + runs-on: ubuntu-latest + matrix: linux + arch: armhf + release: bionic mirror: http://ports.ubuntu.com/ubuntu-ports version: 1.5.6.3 pypkg: python2.7 pyver: "2.7" getpipurl: https://bootstrap.pypa.io/pip/2.7/get-pip.py pyengine_tag: cp27-cp27mu - - name: Ubuntu 24+16 arm64 CPython 2.7 + libc_tag: manylinux_2_17 + - name: Ubuntu 24+18 arm64 CPython 2.7 runs-on: ubuntu-latest matrix: linux arch: arm64 - release: xenial + release: bionic mirror: http://ports.ubuntu.com/ubuntu-ports version: 1.5.6.3 pypkg: python2.7 pyver: "2.7" getpipurl: https://bootstrap.pypa.io/pip/2.7/get-pip.py pyengine_tag: cp27-cp27mu + libc_tag: manylinux_2_17 - name: Ubuntu 24+20 riscv64 CPython 2.7 runs-on: ubuntu-latest matrix: linux @@ -197,6 +295,7 @@ jobs: pyver: "2.7" getpipurl: https://bootstrap.pypa.io/pip/2.7/get-pip.py pyengine_tag: cp27-cp27mu + libc_tag: manylinux_2_19 steps: - name: Checkout code @@ -204,21 +303,6 @@ jobs: 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: | @@ -228,6 +312,7 @@ jobs: sudo apt install -y zram-config; sudo apt list --upgradable; sudo apt upgrade -y; + sudo apt install -f - name: Build source distribution with Ubuntu if: matrix.os.matrix == 'linux' @@ -236,15 +321,15 @@ jobs: pip install build; python -m build --sdist --outdir dist . - - name: Debootstrap Ubuntu ${{matrix.os.arch}} + - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{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}} + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log - 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 mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/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 @@ -252,6 +337,7 @@ jobs: echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt 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 @@ -260,6 +346,9 @@ jobs: 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 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt upgrade -y + - name: Pepare dev files if: matrix.os.matrix == 'linux' @@ -271,7 +360,7 @@ jobs: run: | sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y ${{matrix.os.pypkg}}-dev gcc pkg-config ${{matrix.os.pypkgadd}} sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U setuptools" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" - name: Pepare source and build wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' @@ -279,7 +368,8 @@ jobs: 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" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} pkg-config libzstd --modversion + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ZSTD_ASM=1 _ZSTD_LEGACY=1 _ZSTD_ASM_BMI2=1 ZSTD_THREADS=1 _ZSTD_EXTERNAL=0 python${{matrix.os.pyver}} setup.py bdist_wheel clean" - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' @@ -290,7 +380,8 @@ jobs: 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 ls -lh ./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}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" sudo rm -vf ./dist/*.tar.gz - name: Build ${{ matrix.os.name }} wheels and test (old) diff --git a/README.rst b/README.rst index dae0b4ace..193929875 100644 --- a/README.rst +++ b/README.rst @@ -2,20 +2,135 @@ python-zstd ============= -.. |releaseW| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml/badge.svg?tag=v1.5.6.2 +.. |releaseW| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml/badge.svg?tag=v1.5.6.3 :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml .. |masterW| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml/badge.svg :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml -+---------+------------+ -| branch | status | -+=========+============+ -| Release | |releaseW| | -| 1.5.6.2 | | -+---------+------------+ -| Master | |masterW| | -+---------+------------+ +.. |cpython27x64| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython27_x86_64.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython27_x86_64.yml + +.. |cpython27x86| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython27_x86.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython27_x86.yml + +.. |cpython27armhf| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython27_armhf.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython27_armhf.yml + +.. |cpython34x86| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython34_x86.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython34_x86.yml + +.. |cpython34x64| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython34_x86_64.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython34_x86_64.yml + +.. |cpython35x86| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython35_x86.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython35_x86.yml + +.. |cpython35x64| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython35_x86_64.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython35_x86_64.yml + +.. |cpython36x86| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython36_x86.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython36_x86.yml + +.. |cpython36x64| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython36_x86_64.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython36_x86_64.yml + +.. |cpython37x86| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython37_x86.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython37_x86.yml + +.. |cpython37x64| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython37_x86_64_u24.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython37_x86_64_u24.yml + +.. |cpython38x86| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython38_x86.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython38_x86.yml + +.. |cpython38x64| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython38_x86_64_u24.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython38_x86_64_u24.yml + +.. |cpython39x86| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython39_x86.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython39_x86.yml + +.. |cpython39x64| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython39_x86_64_u24.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython39_x86_64_u24.yml + +.. |cpython310x86u16| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython310_x86_u16.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython310_x86_u16.yml + +.. |cpython310x64u20| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython310_x86_64_u24.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython310_x86_64_u24.yml + +.. |cpython311x86u16| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython311_x86_u16.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython311_x86_u16.yml + +.. |cpython311x64u20| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython311_x86_64_u24.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython311_x86_64_u24.yml + +.. |cpython312x86u16| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython312_x86_u16.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython312_x86_u16.yml + +.. |cpython312x64u20| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython312_x86_64_u20.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython312_x86_64_u20.yml + +.. |cpython313x64u20| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython313_x86_64_u24.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython313_x86_64_u24.yml + +.. |cpython314x64u20| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython314_x86_64_u24.yml/badge.svg + :target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/Build_wheels_for_cpython314_x86_64_u24.yml + ++----------------------+---------------------+ +| wheels for: | status | ++======================+=====================+ +| cpython 2.7 x86 | |cpython27x86| | ++----------------------+---------------------+ +| cpython 2.7 x64 | |cpython27x64| | ++----------------------+---------------------+ +| cpython 2.7 armhf | |cpython27armhf| | ++----------------------+---------------------+ +| cpython 3.4 x86 | |cpython34x86| | ++----------------------+---------------------+ +| cpython 3.4 x64 | |cpython34x64| | ++----------------------+---------------------+ +| cpython 3.5 x86 | |cpython35x86| | ++----------------------+---------------------+ +| cpython 3.5 x64 | |cpython35x64| | ++----------------------+---------------------+ +| cpython 3.6 x86 | |cpython36x86| | ++----------------------+---------------------+ +| cpython 3.6 x64 | |cpython36x64| | ++----------------------+---------------------+ +| cpython 3.7 x86 | |cpython37x86| | ++----------------------+---------------------+ +| cpython 3.7 x64 u24 | |cpython37x64| | ++----------------------+---------------------+ +| cpython 3.8 x86 | |cpython38x86| | ++----------------------+---------------------+ +| cpython 3.8 x64 u24 | |cpython38x64| | ++----------------------+---------------------+ +| cpython 3.9 x86 | |cpython39x86| | ++----------------------+---------------------+ +| cpython 3.9 x64 u24 | |cpython39x64| | ++----------------------+---------------------+ +| cpython 3.10 x86 u16 | |cpython310x86u16| | ++----------------------+---------------------+ +| cpython 3.10 x64 u24 | |cpython310x64u20| | ++----------------------+---------------------+ +| cpython 3.11 x86 u16 | |cpython311x86u16| | ++----------------------+---------------------+ +| cpython 3.11 x64 u24 | |cpython311x64u20| | ++----------------------+---------------------+ +| cpython 3.12 x86 u16 | |cpython312x86u16| | ++----------------------+---------------------+ +| cpython 3.12 x64 u24 | |cpython312x64u20| | ++----------------------+---------------------+ +| cpython 3.13 x64 u24 | |cpython313x64u20| | ++----------------------+---------------------+ +| cpython 3.14 x64 u24 | |cpython314x64u20| | ++----------------------+---------------------+ +| Release | |releaseW| | +| 1.5.6.3 | | ++----------------------+---------------------+ +| Master | |masterW| | ++----------------------+---------------------+ Simple python bindings to Yann Collet ZSTD compression library. @@ -74,6 +189,16 @@ Build from source >>> $ python setup.py build_ext clean >>> $ python3 setup.py build_ext clean +And you need to install `libzstd` developer files at least version *1.4.0*: + + >>> $ dnf install -y libzstd-devel + # or + >>> $ apt install -y libzstd-dev + # or + >>> $ apk add zstd-dev + +or do manual installation of zstd from source. + Note: Zstd legacy format support disabled by default. To build with Zstd legacy versions support - pass ``--legacy`` option to setup.py script: @@ -131,6 +256,14 @@ If paths to header file ``zstd.h`` and libraries is uncommon - use common ``buil >>> $ python setup.py build_ext --external --include-dirs /opt/zstd/usr/include --libraries zstd --library-dirs /opt/zstd/lib clean +But If you want to build with bundled distribution of libzstd just add ``-- +libzstd-bundled`` option + + >>> $ python setup.py build_ext --libzstd-bundled clean + +When using a PEP 517 builder you can use ``ZSTD_BUNDLED`` environment variable instead: + + >>> $ ZSTD_BUNDLED=1 python -m build -w Install from pypi ----------------- @@ -200,6 +333,7 @@ ZSTD_check (data): int Aliases: - *check(...)*, + - *verify(...)* since: 1.5.6.3 Since: 1.5.6.2 @@ -246,6 +380,11 @@ ZSTD_external (): int Since: 1.5.0.2 +ZSTD_legacy_support (): int + Returns 0 of 1 if ZSTD library built with legacy formats support. + + Since: 1.5.6.3 + ZSTD_with_threads (): int Returns 0 of 1 if bundled ZSTD library build with threads support. diff --git a/glibc-check.sh b/glibc-check.sh index 76b4f540a..7811f9bf4 100644 --- a/glibc-check.sh +++ b/glibc-check.sh @@ -5,7 +5,7 @@ # # You can set `MAX_VER` however low you want, although I (fasterthanlime) # feel like `2.13` is a good target (For reference, Ubuntu 12.04 has GLIBC 2.15) -MAX_VER=2.13 +MAX_VER=2.34 SCRIPTPATH=$( cd $(dirname $0) ; pwd -P ) BINARY=$1 diff --git a/setup.py b/setup.py index faf645e22..62a206a4e 100644 --- a/setup.py +++ b/setup.py @@ -2,13 +2,18 @@ import os import sys + +#debug +# print("\ncmdline: %r" % (sys.argv,)) + import subprocess +import platform import setuptools from setuptools import setup, find_packages, Extension from setuptools.command.build_ext import build_ext -# ZSTD version +# bundled ZSTD version VERSION = (1, 5, 6,) VERSION_STR = ".".join([str(x) for x in VERSION]) @@ -74,26 +79,55 @@ SUP_EXTERNAL=True sys.argv.remove("--external") -if SUP_EXTERNAL: +pkgconf = "/usr/bin/pkg-config" +if "--libzstd-bundled" in sys.argv: + # Do you want use external Zstd library? + SUP_EXTERNAL=False + sys.argv.remove("--libzstd-bundled") + pkgconf = "/usr/bin/do-not-use-pkg-config" + +#if SUP_EXTERNAL: +if platform.system() == "Linux" and "build_ext" in sys.argv or "build" in sys.argv or "bdist_wheel" in sys.argv: # You should add external library by option: --libraries zstd # And probably include paths by option: --include-dirs /usr/include/zstd # And probably library paths by option: --library-dirs /usr/lib/i386-linux-gnu # We need pkg-config here! - pkgconf = "/usr/bin/pkg-config" if os.path.exists(pkgconf): + #debug + #print("pkg-config exists") cmd = [pkgconf, "libzstd", "--modversion"] + if sys.hexversion >= 0x03000000: + VERSION_STR=b'' + else: + VERSION_STR="" if sys.hexversion >= 0x02070000: - VERSION_STR = subprocess.check_output(cmd) + try: + VERSION_STR = subprocess.check_output(cmd).strip() + except Exception as e: + print("Error: %r" % e) + pass else: # Pure Python 2.6 - VERSION_STR = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] + VERSION_STR = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0].strip() if sys.hexversion >= 0x03000000: # It's bytes in PY3 VERSION_STR = VERSION_STR.decode() - VERSION = tuple(int(v) for v in VERSION_STR.split(".")) - if "--libraries" not in sys.argv: - # Add something default - ext_libraries=["zstd"] + print("\nFound libzstd version %r" % VERSION_STR) + if VERSION_STR and SUP_EXTERNAL: + if VERSION_STR>="1.4.0": + SUP_EXTERNAL=True + if "--libraries" not in sys.argv: + # Add something default + ext_libraries=["zstd"] + else: + raise RuntimeError("Need zstd library verion >= 1.4.0") + VERSION = tuple(int(v) for v in VERSION_STR.split(".")) + else: + if SUP_EXTERNAL: + # Require pkg config + raise RuntimeError("Need pkg-config to find system libzstd.") + print("\n Need pkg-config to find system libzstd. Or we try bundled one.") + # Package version, even external @@ -236,6 +270,7 @@ def my_test_suite(): test_suite = unittest.TestSuite() test_suite.addTest(unittest.defaultTestLoader.loadTestsFromName("tests.test_compress")) test_suite.addTest(unittest.defaultTestLoader.loadTestsFromName("tests.test_version")) + test_suite.addTest(unittest.defaultTestLoader.loadTestsFromName("tests.test_speed")) return test_suite test_func_name = "setup.my_test_suite" @@ -277,5 +312,6 @@ def my_test_suite(): 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', ] ) diff --git a/src/python-zstd.c b/src/python-zstd.c index 084b95f05..77041b5dd 100644 --- a/src/python-zstd.c +++ b/src/python-zstd.c @@ -302,6 +302,14 @@ static PyObject *py_zstd_library_version_int(PyObject* self, PyObject *args) return Py_BuildValue("i", ZSTD_VERSION_NUMBER); } +/** + * Returns ZSTD library legacy formats support + */ +static PyObject *py_zstd_library_legacy_format_support(PyObject* self, PyObject *args) +{ + return Py_BuildValue("i", ZSTD_LEGACY_SUPPORT); +} + /** * Returns 0 or 1 if ZSTD library build as external */ @@ -370,6 +378,7 @@ static PyMethodDef ZstdMethods[] = { {"ZSTD_uncompress", py_zstd_uncompress, METH_VARARGS, UNCOMPRESS_DOCSTRING}, {"ZSTD_check", py_zstd_check, METH_VARARGS, CHECK_DOCSTRING}, {"check", py_zstd_check, METH_VARARGS, CHECK_DOCSTRING}, + {"verify", py_zstd_check, METH_VARARGS, CHECK_DOCSTRING}, {"compress", py_zstd_compress_mt, METH_VARARGS, COMPRESS_DOCSTRING}, {"uncompress", py_zstd_uncompress, METH_VARARGS, UNCOMPRESS_DOCSTRING}, {"encode", py_zstd_compress_mt, METH_VARARGS, COMPRESS_DOCSTRING}, @@ -386,6 +395,7 @@ static PyMethodDef ZstdMethods[] = { {"ZSTD_max_compression_level", py_zstd_max_compression_level, METH_NOARGS, ZSTD_MAX_COMPRESSION_LEVEL_DOCSTRING}, {"ZSTD_external", py_zstd_library_external, METH_NOARGS, ZSTD_EXTERNAL_DOCSTRING}, + {"ZSTD_legacy_support", py_zstd_library_legacy_format_support, METH_NOARGS, ZSTD_LEGACY_DOCSTRING}, {"ZSTD_with_threads", py_zstd_with_threads, METH_NOARGS, ZSTD_WITH_THREADS_DOCSTRING}, {"ZSTD_with_asm", py_zstd_with_asm, METH_NOARGS, ZSTD_WITH_ASM_DOCSTRING}, {NULL, NULL, 0, NULL} diff --git a/src/python-zstd.h b/src/python-zstd.h index c9c987314..40dae914d 100644 --- a/src/python-zstd.h +++ b/src/python-zstd.h @@ -47,6 +47,15 @@ #define LIBZSTD_EXTERNAL 0 #endif +/*-===== Do you build threads support? =====-*/ +#ifndef ZSTD_MULTITHREAD +#define ZSTD_MULTITHREAD 1 +#endif + +/*-===== Do you build legacy format support? =====-*/ +#ifndef ZSTD_LEGACY_SUPPORT +#define ZSTD_LEGACY_SUPPORT 0 +#endif /*-===== Pre-defined compression levels =====-*/ #ifndef ZSTD_CLEVEL_DEFAULT @@ -113,6 +122,7 @@ Raises a zstd.Error exception if any error occurs." #define ZSTD_VERSION_DOCSTRING "ZSTD_version(): string -- Returns ZSTD library version as string." #define ZSTD_INT_VERSION_DOCSTRING "ZSTD_version_number(): int -- Returns ZSTD library version as integer.\n Format of the number is: major * 100*100 + minor * 100 + release." #define ZSTD_EXTERNAL_DOCSTRING "ZSTD_external(): int -- Returns 0 or 1 if ZSTD library build as external." +#define ZSTD_LEGACY_DOCSTRING "ZSTD_legacy_support(): int -- Returns 0 or 1 if ZSTD library build with legacy formats support." #define ZSTD_WITH_THREADS_DOCSTRING "ZSTD_with_threads(): int -- Returns 0 or 1 if ZSTD library build with threads support." #define ZSTD_WITH_ASM_DOCSTRING "ZSTD_with_asm(): int -- Returns 0 or 1 if ZSTD library build with assembler support." #define ZSTD_THREADS_COUNT_DOCSTRING "ZSTD_threads_count(): int -- Returns ZSTD determined CPU cores count in integer." diff --git a/tests/__init__.py b/tests/__init__.py index 33909f666..f779eb76d 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -6,3 +6,5 @@ if sys.hexversion < 0x03000000: import test_compress import test_version + import test_speed + diff --git a/tests/base.py b/tests/base.py index 6070cde0e..17eb9b00e 100644 --- a/tests/base.py +++ b/tests/base.py @@ -23,9 +23,14 @@ def raise_skip(msg): log.info("Python version: %s" % sys.version) log.info("Machine:%s; processor:%s; system:%r; release:%r" % ( platform.machine(), platform.processor(), platform.system(), platform.release())) log.info("libzstd linked external:%r"% zstd.ZSTD_external()) +log.info("libzstd built with legacy formats support:%r"% zstd.ZSTD_legacy_support()) log.info("zstd max number of threads:%r"% zstd.ZSTD_max_threads_count()) +log.info("zstd found CPU cores :%r"% zstd.ZSTD_threads_count()) log.info("zstd max compression level:%r"% zstd.ZSTD_max_compression_level()) log.info("zstd min compression level:%r"% zstd.ZSTD_min_compression_level()) +log.info("pyzstd module version: %r"% zstd.version()) +log.info("libzstd version: %r"% zstd.ZSTD_version()) + # Classic lorem ipsum # + За словесными горами @@ -52,6 +57,8 @@ class BaseTestZSTD(unittest.TestCase): PKG_VERSION = "1.5.6.3" def helper_version(self): + if zstd.ZSTD_external(): + return raise_skip("PyZstd was build with external version of ZSTD library, so module is like (%s). It can be any version. Almost." % zstd.version()) self.assertEqual(self.PKG_VERSION, zstd.version()) def helper_zstd_version(self): diff --git a/tests/test_speed.py b/tests/test_speed.py index 68f0d21e2..80a0c1c21 100644 --- a/tests/test_speed.py +++ b/tests/test_speed.py @@ -10,42 +10,42 @@ def test_00_system_info(self): log.info("Bundled libzstd uses threads? :%r" % zstd.ZSTD_with_threads()) def test_compression_speed(self): - log.info("\nWait 60 seconds...") - sec = 60 + wait = 30 + log.info("\nWait %d seconds..." % wait) sum = 0 l=len(tDATA) tbegin = time() - while time()-tbegin