diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 2ccd63a2..fdbace47 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -27,12 +27,82 @@ jobs: name: source path: ./dist/*.tar.gz - build_python3_wheels: + build_python3_wheels_linux_x86: + name: Build Python 3 wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + os: ubuntu-22.04 + + if: github.actor == 'Legrandin' + + steps: + - uses: actions/checkout@v3 + + - uses: pypa/cibuildwheel@v2.21.1 + name: Build wheels + env: + # cibuildwheel will build wheel once and test it for each CPython version + # and for PyPy > 3.8. + CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*" + CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014" + CIBW_MANYLINUX_I686_IMAGE: "manylinux2014" + CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "manylinux2014" + CIBW_MANYLINUX_PYPY_I686_IMAGE: "manylinux2014" + CIBW_FREE_THREADED_SUPPORT: "true" + CIBW_BEFORE_TEST_LINUX: "(ldd /bin/ls | grep -q musl && apk add gmp) || true" + + # Set pycryptodome/x test command according to built package + CIBW_TEST_COMMAND: + "${{ endsWith(github.ref, 'x') == true && + 'python -m Cryptodome.SelfTest --skip-slow-tests' || + 'python -m Crypto.SelfTest --skip-slow-tests' }}" + + - name: Delete manylinux1 wheels + run: | + rm -f wheelhouse/*-manylinux1_i686.whl + rm -f wheelhouse/*-manylinux1_x86_64.whl + + - uses: actions/upload-artifact@v3 + with: + name: wheels + path: ./wheelhouse/*.whl + + build_python3_wheels_windows: name: Build Python 3 wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, windows-2019, macos-13] + os: windows-2019 + + if: github.actor == 'Legrandin' + + steps: + - uses: actions/checkout@v3 + + - uses: pypa/cibuildwheel@v2.21.1 + name: Build wheels + env: + # cibuildwheel will build wheel once and test it for each CPython version + # and for PyPy > 3.8. + CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*" + CIBW_FREE_THREADED_SUPPORT: "true" + + # Set pycryptodome/x test command according to built package + CIBW_TEST_COMMAND: + "${{ endsWith(github.ref, 'x') == true && + 'python -m Cryptodome.SelfTest --skip-slow-tests' || + 'python -m Crypto.SelfTest --skip-slow-tests' }}" + + - uses: actions/upload-artifact@v3 + with: + name: wheels + path: ./wheelhouse/*.whl + + build_python3_wheels_macos: + name: Build Python 3 wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: macos-13 if: github.actor == 'Legrandin' @@ -42,7 +112,37 @@ jobs: - name: Select architecture for MacOS run: | echo 'CIBW_ARCHS=x86_64 universal2' >> $GITHUB_ENV - if: runner.os == 'macOS' + + - uses: pypa/cibuildwheel@v2.21.1 + name: Build wheels + env: + # cibuildwheel will build wheel once and test it for each CPython version + # and for PyPy > 3.8. + CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*" + CIBW_FREE_THREADED_SUPPORT: "true" + + # Set pycryptodome/x test command according to built package + CIBW_TEST_COMMAND: + "${{ endsWith(github.ref, 'x') == true && + 'python -m Cryptodome.SelfTest --skip-slow-tests' || + 'python -m Crypto.SelfTest --skip-slow-tests' }}" + + - uses: actions/upload-artifact@v3 + with: + name: wheels + path: ./wheelhouse/*.whl + + build_python3_wheels_linux_arm: + name: Build Python 3 wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ubuntu-22.04-arm + + if: github.actor == 'Legrandin' + + steps: + - uses: actions/checkout@v3 - uses: pypa/cibuildwheel@v2.21.1 name: Build wheels