| name: "Build Python DB API Driver Wheels" |
| |
| on: |
| workflow_dispatch: |
| |
| jobs: |
| build_source_dist: |
| name: Build source distribution |
| runs-on: ubuntu-latest |
| |
| steps: |
| - uses: actions/checkout@v4 |
| |
| - uses: actions/setup-python@v5 |
| |
| - name: Install setuptools |
| run: python -m pip install setuptools |
| |
| - name: Copy C++ sources |
| run: cp -r modules/platforms/cpp modules/platforms/python/ |
| |
| - name: Build source distribution |
| working-directory: modules/platforms/python |
| run: python setup.py sdist --formats=gztar --dist-dir ./dist |
| |
| - uses: actions/upload-artifact@v4 |
| with: |
| name: source-distributions |
| path: modules/platforms/python/dist/* |
| |
| build_wheels: |
| name: Build wheels on ${{ matrix.os }} |
| runs-on: ${{ matrix.os }} |
| strategy: |
| matrix: |
| # macos-13 is an intel runner, macos-14 is apple silicon |
| os: [ubuntu-22.04, ubuntu-24.04-arm, windows-2022, macos-13, macos-14] |
| |
| steps: |
| - uses: actions/checkout@v4 |
| |
| - uses: actions/setup-python@v5 |
| |
| - name: Install cibuildwheel |
| run: python -m pip install cibuildwheel==2.23.1 |
| |
| - name: Build wheels macOS 14 |
| if: matrix.os == 'macos-14' |
| run: python -m cibuildwheel --output-dir modules/platforms/python/wheels modules/platforms/python |
| env: |
| CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-* |
| CIBW_ARCHS: arm64 |
| MACOSX_DEPLOYMENT_TARGET: 14.0 |
| CIBW_BUILD_VERBOSITY: 1 |
| |
| - name: Build wheels macOS 13 |
| if: matrix.os == 'macos-13' |
| run: python -m cibuildwheel --output-dir modules/platforms/python/wheels modules/platforms/python |
| env: |
| CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-* |
| CIBW_ARCHS: x86_64 |
| MACOSX_DEPLOYMENT_TARGET: 13.0 |
| CIBW_BUILD_VERBOSITY: 1 |
| |
| - name: Build wheels Linux |
| if: runner.os == 'Linux' |
| run: python -m cibuildwheel --output-dir modules/platforms/python/wheels modules/platforms/python |
| env: |
| CIBW_BUILD: cp39-manylinux* cp31{0,1,2,3}-manylinux* |
| CIBW_ARCHS: auto64 |
| CIBW_BEFORE_ALL: yum -y install openssl-devel |
| CIBW_BUILD_VERBOSITY: 1 |
| |
| - name: Install Winget |
| if: runner.os == 'Windows' |
| uses: Cyberboss/install-winget@v1 |
| |
| - name: Install OpenSSL on Windows |
| if: runner.os == 'Windows' |
| run: winget install --id=ShiningLight.OpenSSL.Dev -e --accept-source-agreements --disable-interactivity |
| |
| - name: Build wheels Windows |
| if: runner.os == 'Windows' |
| run: python -m cibuildwheel --output-dir modules/platforms/python/wheels modules/platforms/python |
| env: |
| CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-* |
| CIBW_ARCHS: AMD64 |
| CIBW_BUILD_VERBOSITY: 1 |
| |
| - uses: actions/upload-artifact@v4 |
| with: |
| name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} |
| path: modules/platforms/python/wheels/*.whl |
| |
| merge: |
| runs-on: ubuntu-latest |
| needs: [build_source_dist, build_wheels] |
| steps: |
| - name: Merge Artifacts |
| uses: actions/upload-artifact/merge@v4 |
| with: |
| name: python-dbapi-all-artifacts |