Test release builds without publishing #78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release build check | |
| on: | |
| push: | |
| branches: | |
| - release-build-check-b63c384 | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-sdist: | |
| runs-on: ubuntu-22.04 | |
| env: | |
| PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
| steps: | |
| - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
| with: | |
| fetch-depth: 50 | |
| submodules: true | |
| - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: 3.x | |
| - name: Build source distribution | |
| run: | | |
| python -m pip install --upgrade setuptools wheel pip | |
| python setup.py sdist | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: dist-sdist | |
| path: dist/*.tar.* | |
| build-wheels: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - ubuntu-22.04-arm | |
| - macos-15-intel | |
| - macos-latest | |
| python: | |
| - "cp38" | |
| - "cp39" | |
| - "cp310" | |
| - "cp311" | |
| - "cp312" | |
| - "cp313" | |
| - "cp314" | |
| - "cp314t" | |
| - "cp315" | |
| - "cp315t" | |
| include: | |
| - os: ubuntu-latest | |
| cibw_arch: x86_64 | |
| - os: ubuntu-22.04-arm | |
| cibw_arch: aarch64 | |
| # Use native OpenSSL when compiling x86_64 test dependencies. | |
| - os: macos-15-intel | |
| cibw_arch: x86_64 | |
| - os: macos-latest | |
| cibw_arch: universal2 | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
| CIBW_BUILD_VERBOSITY: 1 | |
| CIBW_BUILD: ${{ matrix.python }}-* | |
| CIBW_ARCHS: ${{ matrix.cibw_arch }} | |
| # Let tests inside Linux containers recognize GitHub CI. | |
| CIBW_ENVIRONMENT_PASS_LINUX: GITHUB_WORKFLOW | |
| # Exercise arm64 here; x86_64 wheels have their own test jobs. | |
| CIBW_TEST_SKIP: "*universal2:x86_64" | |
| steps: | |
| - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
| with: | |
| fetch-depth: 50 | |
| submodules: true | |
| - name: Install macOS deps | |
| if: startsWith(matrix.os, 'macos') | |
| run: | | |
| brew install gnu-sed libtool autoconf automake openssl@3 | |
| echo "OPENSSL_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV" | |
| # cibuildwheel 4 added Python 3.15 but removed Python 3.8. | |
| - uses: pypa/cibuildwheel@7c619efba910c04005a835b110b057fc28fd6e93 # v3.2.0 | |
| if: matrix.python == 'cp38' | |
| - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 | |
| if: matrix.python != 'cp38' | |
| env: | |
| CIBW_BEFORE_ALL_LINUX: >- | |
| ${{ matrix.python == 'cp315t' && 'bash {project}/.github/workflows/install-linux-test-deps.sh' || '' }} | |
| # Build universal2 wheels, but compile their test dependencies for arm64. | |
| CIBW_TEST_ENVIRONMENT_MACOS: >- | |
| ${{ matrix.cibw_arch == 'universal2' | |
| && 'ARCHFLAGS="-arch arm64" _PYTHON_HOST_PLATFORM="macosx-11.0-arm64"' | |
| || '' }} | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: dist-wheels-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.cibw_arch }} | |
| path: wheelhouse/*.whl |