Skip to content

Commit

Permalink
chg: ci: update wheel builds for Linux, Macos, and Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen L Arnold <[email protected]>
  • Loading branch information
sarnold committed Jan 13, 2021
1 parent 85bc93e commit 0e4330f
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 26 deletions.
42 changes: 29 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,52 @@ jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }} for Python
runs-on: ${{ matrix.os }}
env:
MANYLINUX2010_X86_64_TAG: "2020-12-03-912b0de"
strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
os: [ubuntu-20.04, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: 3.7
python-version: '3.8'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.7.1
- name: Install Visual C++ for Python 2.7
- name: Prepare compiler environment for Windows
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64

- name: Install cibuildwheel
run: |
choco install vcpython27 -f -y
python -m pip install --upgrade pip
pip install -r requirements-cibw.txt
- name: Build wheels
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: cp36-* cp37-* cp38-* cp39-*
CIBW_SKIP: "*-win32"
CIBW_BEFORE_ALL_LINUX: >
yum -y -q --enablerepo=extras install epel-release
&& yum install -y re2-devel
CIBW_BEFORE_ALL_MACOS: brew install re2
CIBW_BUILD: cp36-* cp37-* cp38-*
&& yum install -y re2-devel ninja-build
&& pip install .
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH auditwheel repair -w {dest_dir} {wheel}"
CIBW_BEFORE_ALL_MACOS: >
brew install -s re2
&& brew install pybind11 ninja
&& pip install .
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.09
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "DYLD_LIBRARY_PATH=/usr/local/Cellar/re2/20201101/lib:$DYLD_LIBRARY_PATH delocate-listdeps {wheel} && delocate-wheel -w {dest_dir} -v {wheel}"
CIBW_BEFORE_ALL_WINDOWS: >
vcpkg install re2:x64-windows
&& vcpkg integrate install
&& pip 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
Expand Down
45 changes: 32 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ jobs:
create_wheels:
name: Build wheels on ${{ matrix.os }} for Python
runs-on: ${{ matrix.os }}
env:
MANYLINUX2010_X86_64_TAG: "2020-12-03-912b0de"
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-latest]
os: [ubuntu-20.04, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v2
Expand All @@ -25,22 +22,43 @@ jobs:
with:
python-version: 3.7

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.7.1
- name: Install Visual C++ for Python 2.7
- name: Prepare compiler environment for Windows
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64

- name: Install cibuildwheel
run: |
choco install vcpython27 -f -y
python -m pip install --upgrade pip
pip install -r requirements-cibw.txt
- name: Build wheels
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: cp36-* cp37-* cp38-* cp39-*
CIBW_SKIP: "*-win32"
CIBW_BEFORE_ALL_LINUX: >
yum -y -q --enablerepo=extras install epel-release
&& yum install -y re2-devel
CIBW_BEFORE_ALL_MACOS: brew install re2
CIBW_BUILD: cp36-* cp37-* cp38-*
&& yum install -y re2-devel ninja-build
&& pip install .
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH auditwheel repair -w {dest_dir} {wheel}"
CIBW_BEFORE_ALL_MACOS: >
brew install -s re2
&& brew install pybind11 ninja
&& pip install .
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.09
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "DYLD_LIBRARY_PATH=/usr/local/Cellar/re2/20201101/lib:$DYLD_LIBRARY_PATH delocate-listdeps {wheel} && delocate-wheel -w {dest_dir} -v {wheel}"
CIBW_BEFORE_ALL_WINDOWS: >
vcpkg install re2:x64-windows
&& vcpkg integrate install
&& pip 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
- uses: actions/upload-artifact@v2
with:
name: wheels
Expand Down Expand Up @@ -91,4 +109,5 @@ jobs:
body_path: CHANGES.md
draft: false
prerelease: false
files: ./pyre2*.whl
# uncomment below to upload wheels to github releases
# files: ./pyre2*.whl

0 comments on commit 0e4330f

Please sign in to comment.