|
| 1 | +name: Build wheels |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + name: Build wheels on ${{ matrix.os }} (${{ matrix.arch }}) |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + include: |
| 19 | + - os: ubuntu-24.04 |
| 20 | + arch: x86_64 |
| 21 | + build-sdist: true |
| 22 | + - os: ubuntu-24.04 |
| 23 | + arch: i686 |
| 24 | + - os: ubuntu-24.04 |
| 25 | + arch: aarch64 |
| 26 | + - os: macos-12 |
| 27 | + arch: x86_64 universal2 |
| 28 | + - os: windows-2022 |
| 29 | + arch: x86 |
| 30 | + before: vcpkg install openssl:x86-windows-static |
| 31 | + env: LIB="C:\\vcpkg\\packages\\openssl_x86-windows-static\\lib" INCLUDE="C:\\vcpkg\\packages\\openssl_x86-windows-static\\include" |
| 32 | + - os: windows-2022 |
| 33 | + arch: AMD64 |
| 34 | + before: vcpkg install openssl:x64-windows-static |
| 35 | + env: LIB="C:\\vcpkg\\packages\\openssl_x64-windows-static\\lib" INCLUDE="C:\\vcpkg\\packages\\openssl_x64-windows-static\\include" |
| 36 | + |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + with: |
| 40 | + submodules: true |
| 41 | + |
| 42 | + - name: Set up QEMU |
| 43 | + if: runner.os == 'Linux' |
| 44 | + uses: docker/setup-qemu-action@v3 |
| 45 | + with: |
| 46 | + platforms: all |
| 47 | + |
| 48 | + - name: Build wheels |
| 49 | + |
| 50 | + with: |
| 51 | + output-dir: dist |
| 52 | + env: |
| 53 | + CIBW_ARCHS: ${{ matrix.arch }} |
| 54 | + CIBW_BEFORE_ALL_LINUX: | |
| 55 | + if [[ ! -z "$(which yum)" ]]; then |
| 56 | + yum install -y make gcc perl-core pcre-devel wget zlib-devel git automake |
| 57 | + wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz |
| 58 | + tar xf openssl*.gz |
| 59 | + cd openssl* |
| 60 | + ./config --prefix=/usr --openssldir=/etc/ssl zlib-dynamic |
| 61 | + make -j$(nproc) |
| 62 | + make install |
| 63 | + elif [[ ! -z "$(which apk)" ]]; then |
| 64 | + apk add openssl-dev |
| 65 | + fi |
| 66 | + CIBW_BEFORE_ALL_WINDOWS: ${{ matrix.before }} |
| 67 | + CIBW_BUILD_FRONTEND: build |
| 68 | + CIBW_ENVIRONMENT: ${{ matrix.env }} |
| 69 | + CIBW_SKIP: cp36-* |
| 70 | + CIBW_TEST_SKIP: "*-macosx_universal2:arm64" |
| 71 | + CIBW_TEST_COMMAND: python {package}/tests.py |
| 72 | + |
| 73 | + - name: Store the distribution packages |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: python-package-distributions-${{ matrix.os }}-${{ matrix.arch }} |
| 77 | + path: dist/*.whl |
| 78 | + |
| 79 | + - name: Build Sdist |
| 80 | + if: ${{ matrix.build-sdist }} |
| 81 | + run: pipx run build --sdist |
| 82 | + |
| 83 | + - name: Store the source distribution package |
| 84 | + if: ${{ matrix.build-sdist }} |
| 85 | + uses: actions/upload-artifact@v4 |
| 86 | + with: |
| 87 | + name: python-package-distributions-source |
| 88 | + path: dist/*.tar.gz |
0 commit comments