diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 217d62d7..0d7da3bd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,11 +6,9 @@ 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 @@ -18,24 +16,42 @@ jobs: - 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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41a5bdb5..09f3e404 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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