Skip to content

Commit

Permalink
Try out cibuildwheel (#1)
Browse files Browse the repository at this point in the history
Setup cibuildwheel to build wheels for linux and macos
  • Loading branch information
ColdHeat authored Nov 21, 2020
1 parent a07b7f1 commit 3d3fe07
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build

on: [push, pull_request]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, macos-latest]

steps:
- uses: actions/checkout@v2

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

- name: Install cibuildwheel
run: |
python3 -m pip install cibuildwheel==1.6.4
- name: Install Visual C++ for Python 2.7
if: runner.os == 'Windows'
run: |
choco install vcpython27 -f -y
- name: Build Linux wheels
if: runner.os == 'Linux'
env:
CIBW_BEFORE_ALL: 'pwd && ls && chmod +x ./scripts/setup-linux.sh && ./scripts/setup-linux.sh'
CIBW_BUILD: cp3?-*
CIBW_SKIP: "cp35-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build macOS wheels
if: runner.os == 'macOS'
env:
CIBW_BEFORE_ALL: 'pwd && ls && chmod +x ./scripts/setup-macos.sh && ./scripts/setup-macos.sh'
CIBW_BUILD: cp3?-*
CIBW_SKIP: "cp35-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
7 changes: 7 additions & 0 deletions scripts/setup-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
if [ ! -f "/usr/bin/go" ]; then
curl -vvv -L -O https://golang.org/dl/go1.15.5.linux-amd64.tar.gz
tar -xf go1.15.5.linux-amd64.tar.gz
mv go /usr/local
ln -s /usr/local/go/bin/go /usr/bin/go
fi
7 changes: 7 additions & 0 deletions scripts/setup-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
if [ ! -f "/usr/local/bin/go" ]; then
curl -vvv -L -O https://golang.org/dl/go1.15.5.darwin-amd64.tar.gz
tar -xf go1.15.5.darwin-amd64.tar.gz
mv go /tmp
ln -s /tmp/go/bin/go /usr/local/bin/go
fi

0 comments on commit 3d3fe07

Please sign in to comment.