Skip to content

Commit

Permalink
fix: dev: update release workflow for new platform wheels
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Arnold <[email protected]>
  • Loading branch information
sarnold committed Sep 10, 2024
1 parent 4a38e78 commit e710ab9
Showing 1 changed file with 48 additions and 31 deletions.
79 changes: 48 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
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:
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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' }}
Expand Down

0 comments on commit e710ab9

Please sign in to comment.