name: Wheels on: push: branches: - main - wheels tags: - "v*.*.*" workflow_dispatch: inputs: debug_enabled: description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)" required: false default: false schedule: # run monthly on the 1st - cron: "0 0 1 * *" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CIBW_ENABLE: pypy CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 # manylinux2014 can't build on aarch64 CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2 CIBW_MUSLLINUX_AARCH64_IMAGE: musllinux_1_2 CIBW_ARCHS_LINUX: auto64 aarch64 CIBW_BEFORE_BUILD_LINUX: "{project}/ci/linux-deps" CIBW_REPAIR_WHEEL_COMMAND_LINUX: 'LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib64" && auditwheel repair -w {dest_dir} {wheel}' CIBW_ARCHS_MACOS: auto64 CIBW_BEFORE_BUILD_MACOS: "{project}/ci/osx-deps" CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" CIBW_ENVIRONMENT: >- CYVCF2_HTSLIB_CONFIGURE_OPTIONS="--enable-libcurl --enable-s3 --enable-lzma --enable-bz2 --with-libdeflate" CIBW_TEST_COMMAND: "{project}/ci/test" jobs: build_wheels: # Full wheel matrix for releases, schedule, and manual runs. if: github.event_name != 'push' || github.ref != 'refs/heads/main' name: Build wheels (full matrix) runs-on: ${{ matrix.buildplat[0] }} strategy: matrix: buildplat: - [ubuntu-22.04, manylinux_x86_64] - [ubuntu-22.04, musllinux_x86_64] - [ubuntu-22.04, manylinux_aarch64] - [ubuntu-22.04, musllinux_aarch64] - [macos-15-intel, macosx_x86_64] - [macos-14, macosx_arm64] python-version: [pp311, cp39, cp310, cp311, cp312, cp313, cp314] exclude: # pp311 not built on musllinux or manylinux_aarch64 # cp39, cp310 on musllinux_aarch64, wheel building may hangup, ignore it # drop 37 so we can use newer cibuildwheel - buildplat: [ubuntu-22.04, manylinux_aarch64] python-version: pp311 - buildplat: [ubuntu-22.04, musllinux_x86_64] python-version: pp311 - buildplat: [ubuntu-22.04, musllinux_aarch64] python-version: cp39 - buildplat: [ubuntu-22.04, musllinux_aarch64] python-version: cp310 - buildplat: [ubuntu-22.04, musllinux_aarch64] python-version: pp311 steps: - uses: actions/checkout@v4 with: submodules: recursive - name: Cache wheel build downloads uses: actions/cache@v4 with: path: | ~/.cache/pip ~/.cache/cibuildwheel key: ${{ runner.os }}-${{ matrix.buildplat[1] }}-cibw-${{ hashFiles('pyproject.toml', 'requirements.txt', 'ci/linux-deps', 'ci/osx-deps') }} restore-keys: | ${{ runner.os }}-${{ matrix.buildplat[1] }}-cibw- ${{ runner.os }}-cibw- - name: Set up QEMU if: runner.os == 'Linux' && contains(matrix.buildplat[1], 'aarch64') uses: docker/setup-qemu-action@v3 - name: Build wheels uses: pypa/cibuildwheel@v4.1.0 with: package-dir: . output-dir: wheelhouse config-file: "{package}/pyproject.toml" env: CIBW_BUILD: ${{ matrix.python-version }}-${{ matrix.buildplat[1] }} # Enable tmate debugging of manually-triggered workflows if the input option was provided - name: Setup tmate session if: ${{ always() && github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }} uses: mxschmitt/action-tmate@v3 - uses: actions/upload-artifact@v4 with: name: artifact-${{ matrix.python-version }}-${{ matrix.buildplat[1] }} path: ./wheelhouse/*.whl build_wheels_smoke: # Smaller matrix on main to keep CI cost controlled. if: github.event_name == 'push' && github.ref == 'refs/heads/main' name: Build wheels (smoke matrix) runs-on: ${{ matrix.buildplat[0] }} strategy: matrix: include: - buildplat: [ubuntu-22.04, manylinux_x86_64] python-version: cp39 - buildplat: [ubuntu-22.04, manylinux_x86_64] python-version: cp314 - buildplat: [ubuntu-22.04, manylinux_x86_64] python-version: pp311 - buildplat: [ubuntu-22.04, musllinux_x86_64] python-version: cp314 - buildplat: [ubuntu-22.04, manylinux_aarch64] python-version: cp314 - buildplat: [ubuntu-22.04, musllinux_aarch64] python-version: cp314 - buildplat: [macos-15-intel, macosx_x86_64] python-version: cp314 - buildplat: [macos-14, macosx_arm64] python-version: cp314 steps: - uses: actions/checkout@v4 with: submodules: recursive - name: Cache wheel build downloads uses: actions/cache@v4 with: path: | ~/.cache/pip ~/.cache/cibuildwheel key: ${{ runner.os }}-${{ matrix.buildplat[1] }}-cibw-${{ hashFiles('pyproject.toml', 'requirements.txt', 'ci/linux-deps', 'ci/osx-deps') }} restore-keys: | ${{ runner.os }}-${{ matrix.buildplat[1] }}-cibw- ${{ runner.os }}-cibw- - name: Set up QEMU if: runner.os == 'Linux' && contains(matrix.buildplat[1], 'aarch64') uses: docker/setup-qemu-action@v3 - name: Build wheels uses: pypa/cibuildwheel@v4.1.0 with: package-dir: . output-dir: wheelhouse config-file: "{package}/pyproject.toml" env: CIBW_BUILD: ${{ matrix.python-version }}-${{ matrix.buildplat[1] }} - uses: actions/upload-artifact@v4 with: name: artifact-smoke-${{ matrix.python-version }}-${{ matrix.buildplat[1] }} path: ./wheelhouse/*.whl build_sdist: name: Build source distribution runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 with: submodules: recursive - uses: actions/setup-python@v5 name: Install Python with: python-version: "3.14" cache: pip cache-dependency-path: requirements.txt - name: Install dependencies run: | python -m pip install --upgrade pip build - name: Build sdist run: python -m build --sdist - uses: actions/upload-artifact@v4 with: name: artifact-sdist path: dist/*.tar.gz upload_pypi: needs: [build_wheels, build_sdist] runs-on: ubuntu-22.04 # upload to PyPI on every tag starting with 'v' if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') steps: - uses: actions/download-artifact@v4 with: pattern: artifact-* merge-multiple: true path: dist - uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }}