Fangjun Kuang
Committed by GitHub

Publish pre-compiled wheels (#32)

  1 +name: build-wheels
  2 +
  3 +on:
  4 + push:
  5 + branches:
  6 + - wheel
  7 + tags:
  8 + - '*'
  9 +
  10 +env:
  11 + SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
  12 +
  13 +concurrency:
  14 + group: build-wheels-${{ github.ref }}
  15 + cancel-in-progress: true
  16 +
  17 +jobs:
  18 + build_wheels:
  19 + name: Build wheels on ${{ matrix.os }}
  20 + runs-on: ${{ matrix.os }}
  21 + strategy:
  22 + fail-fast: false
  23 + matrix:
  24 + os: [ubuntu-latest, windows-latest, macos-latest]
  25 +
  26 + steps:
  27 + - uses: actions/checkout@v2
  28 +
  29 + # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
  30 + # for a list of versions
  31 + - name: Build wheels
  32 + uses: pypa/cibuildwheel@v2.11.4
  33 + env:
  34 + CIBW_BEFORE_BUILD: "pip install -U cmake numpy"
  35 + CIBW_SKIP: "cp27-* cp35-* *-win32 pp* *-musllinux* *-manylinux_i686"
  36 + CIBW_BUILD_VERBOSITY: 3
  37 +
  38 + - name: Display wheels
  39 + shell: bash
  40 + run: |
  41 + ls -lh ./wheelhouse/
  42 +
  43 + ls -lh ./wheelhouse/*.whl
  44 +
  45 + - uses: actions/upload-artifact@v2
  46 + with:
  47 + path: ./wheelhouse/*.whl
  48 +
  49 + - name: Publish wheels to PyPI
  50 + env:
  51 + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  52 + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  53 + run: |
  54 + python3 -m pip install --upgrade pip
  55 + python3 -m pip install wheel twine setuptools
  56 +
  57 + twine upload ./wheelhouse/*.whl