| name: Build Python Wheels |
| |
| on: |
| # allow manual runs |
| workflow_dispatch: |
| # run when we tag a release |
| release: |
| types: |
| - "created" |
| |
| env: |
| BUILD_TYPE: Release |
| |
| jobs: |
| build_sdist: |
| name: Source distribution |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v2 |
| with: |
| submodules: true |
| persist-credentials: false |
| |
| - uses: actions/setup-python@v2 |
| name: Install Python |
| with: |
| python-version: '3.8' |
| |
| - name: Build sdist |
| run: python setup.py sdist |
| |
| - uses: actions/upload-artifact@v2 |
| with: |
| path: dist/*.tar.gz |
| |
| build_wheels: |
| name: ${{ matrix.config.name }} |
| runs-on: ${{ matrix.config.os }} |
| strategy: |
| fail-fast: false |
| matrix: |
| config: |
| - { |
| name: "MacOS Latest, Clang", |
| os: macos-latest, |
| cc: "clang", cxx: "clang++" |
| } |
| - { |
| name: "Ubuntu Latest, GCC", |
| os: ubuntu-latest, |
| cc: "gcc", cxx: "g++" |
| } |
| - { |
| name: "Windows Latest, MSVC", |
| os: windows-latest, |
| cc: "cl", cxx: "cl", |
| environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat" |
| } |
| |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v2 |
| with: |
| submodules: true |
| persist-credentials: false |
| |
| - name: Set up Python 3.x |
| uses: actions/setup-python@v2 |
| with: |
| python-version: '3.8' |
| |
| - name: Install Python dependencies |
| run: python -m pip install --upgrade pip setuptools wheel numpy tox pytest build cibuildwheel==2.1.1 twine |
| |
| - name: Build wheels |
| run: python -m cibuildwheel --output-dir dist |
| env: |
| CIBW_SKIP: "*-win32" |
| CIBW_ARCHS_MACOS: "x86_64 universal2" |
| |
| - uses: actions/upload-artifact@v2 |
| with: |
| path: ./dist/*.whl |