From e710ab9bdd5065a8e3fd9a113ac47c0b76e7e7c4 Mon Sep 17 00:00:00 2001 From: Stephen Arnold Date: Tue, 10 Sep 2024 14:52:55 -0700 Subject: [PATCH] fix: dev: update release workflow for new platform wheels Signed-off-by: Stephen Arnold --- .github/workflows/release.yml | 79 +++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3fd96e0..bc9c7ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,23 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-latest, windows-latest] + include: + - os: "ubuntu-22.04" + arch: "x86_64" + - os: "ubuntu-22.04" + arch: "aarch64" + - os: "macos-13" + arch: "x86_64" + macosx_deployment_target: "13.0" + - os: "macos-14" + arch: "arm64" + macosx_deployment_target: "14.0" + - os: "windows-latest" + arch: "auto64" + triplet: "x64-windows" + - os: "windows-latest" + arch: "auto32" + triplet: "x86-windows" steps: - uses: actions/checkout@v4 @@ -22,43 +38,41 @@ jobs: - uses: actions/setup-python@v5 name: Install Python with: - python-version: '3.8' + python-version: '3.9' - - name: Prepare compiler environment for Windows - if: runner.os == 'Windows' - uses: ilammy/msvc-dev-cmd@v1 + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v3 with: - arch: amd64 - - - name: Install cibuildwheel - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements-cibw.txt + platforms: all - name: Build wheels + uses: pypa/cibuildwheel@v2.20 env: - CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2010_x86_64:latest - CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2010_i686:latest - CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* - CIBW_SKIP: "*-win32" + # configure cibuildwheel to build native archs ('auto'), and some + # emulated ones, plus cross-compile on macos + CIBW_ARCHS: ${{ matrix.arch }} + CIBW_TEST_SKIP: "*_arm64 *universal2:arm64 *linux_i686" + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_MANYLINUX_I686_IMAGE: manylinux2010 + CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* + CIBW_SKIP: "*musllinux* *i686" CIBW_BEFORE_ALL_LINUX: > - yum -y -q --enablerepo=extras install epel-release - && yum install -y re2-devel ninja-build - CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel show {wheel} && auditwheel repair -w {dest_dir} {wheel}" + yum -y update && yum -y install epel-release && yum install -y re2-devel ninja-build CIBW_BEFORE_ALL_MACOS: > - brew install re2 pybind11 ninja - CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.09 - CIBW_REPAIR_WHEEL_COMMAND_MACOS: "pip uninstall -y delocate && pip install git+https://github.com/Chia-Network/delocate.git && delocate-listdeps {wheel} && delocate-wheel -w {dest_dir} -v {wheel}" + brew install re2 pybind11 + # macos target should be at least 10.13 to get full c++17 + CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=${{ matrix.macosx_deployment_target }} CIBW_BEFORE_ALL_WINDOWS: > - vcpkg install re2:x64-windows + vcpkg install pkgconf:${{ matrix.triplet }} re2:${{ matrix.triplet }} && vcpkg integrate install CIBW_ENVIRONMENT_WINDOWS: 'CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake' - CIBW_TEST_COMMAND: python -c "import re2" - run: | - python -m cibuildwheel --output-dir wheelhouse + CIBW_TEST_REQUIRES: "" + CIBW_TEST_COMMAND: "" - uses: actions/upload-artifact@v4 with: + name: wheels-${{ matrix.os }}-${{ matrix.arch }} path: ./wheelhouse/*.whl build_sdist: @@ -70,12 +84,12 @@ jobs: - uses: actions/setup-python@v5 name: Install Python with: - python-version: '3.8' + python-version: '3.9' - name: Build sdist run: | - pip install pep517 - python -m pep517.build -s . + pip install build + python -m build -s . - uses: actions/upload-artifact@v4 with: @@ -99,10 +113,13 @@ jobs: - uses: actions/setup-python@v5 name: Install Python with: - python-version: 3.7 + python-version: 3.9 - # download all artifacts to project dir + # download all artifacts to artifacts dir - uses: actions/download-artifact@v4 + with: + merge-multiple: true + path: artifacts - name: Generate changes file uses: sarnold/gitchangelog-action@master @@ -121,7 +138,7 @@ jobs: draft: false prerelease: false # uncomment below to upload wheels to github releases - files: dist/cibw-wheels/pyre2*.whl + files: artifacts/pyre2* - uses: pypa/gh-action-pypi-publish@master if: ${{ github.actor == github.repository_owner && github.ref == 'refs/heads/master' }}