Skip to content

Build wheels

Build wheels #8

Workflow file for this run

name: Build wheels
on:
workflow_dispatch:
jobs:
build_wheels:
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest, macos-latest ]
python: [ 36, 37, 38, 39, 310]
bitness: [ 32, 64 ]
include:
# Run 32 and 64 bit version in parallel for Linux and Windows
- os: windows-latest
bitness: 64
platform_id: win_amd64
- os: windows-latest
bitness: 32
platform_id: win32
- os: ubuntu-latest
bitness: 64
platform_id: manylinux_x86_64
- os: macos-latest
bitness: 64
platform_id: macosx_x86_64
exclude:
- os: macos-latest
bitness: 32
# This build was broken on OpenMP so is excluded for now
- os: ubuntu-latest
bitness: 32
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: true
- name: Install Python
uses: actions/setup-python@v2
- uses: ilammy/msvc-dev-cmd@v1
if: startsWith(matrix.os, 'windows')
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.3.1
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse owa-epanet
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_BEFORE_ALL_LINUX: git submodule update --init && yum install swig -y
CIBW_BEFORE_ALL_WINDOWS: git submodule update && choco install swig
CIBW_BEFORE_ALL_MACOS: git submodule update && brew install swig ninja libomp
CIBW_BEFORE_BUILD: pip install scikit-build==0.11.1 cmake==3.18.4
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_COMMAND: pytest {package}
CIBW_BEFORE_TEST: pip install scikit-build==0.11.1 cmake==3.18.4
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_SKIP: "*-win32 *-manylinux_i686"
- name: Store artifacts
uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Fix submodules
run: |
cd owa-epanet
git submodule update
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'
- name: Install dependencies
run: |
sudo apt update
sudo apt install swig -y
pip install scikit-build==0.11.1 cmake==3.18.4
- name: Build sdist
run: |
cd owa-epanet
python setup.py sdist
- uses: actions/upload-artifact@v2
with:
path: owa-epanet/dist/*.tar.gz
upload_pypi:
needs: [ build_wheels, build_sdist ]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true