Fangjun Kuang
Committed by GitHub

Publish pre-compiled wheels for Win32 (#199)

  1 +name: build-wheels-win32
  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-win32-${{ github.ref }}
  15 + cancel-in-progress: true
  16 +
  17 +jobs:
  18 + build_wheels_win32:
  19 + name: Build wheels on ${{ matrix.os }}
  20 + runs-on: ${{ matrix.os }}
  21 + strategy:
  22 + fail-fast: false
  23 + matrix:
  24 + os: [windows-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_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-A Win32"
  36 + CIBW_SKIP: "*-win_amd64"
  37 + CIBW_BUILD_VERBOSITY: 3
  38 +
  39 + - name: Display wheels
  40 + shell: bash
  41 + run: |
  42 + ls -lh ./wheelhouse/
  43 +
  44 + ls -lh ./wheelhouse/*.whl
  45 +
  46 + - uses: actions/upload-artifact@v2
  47 + with:
  48 + path: ./wheelhouse/*.whl
  49 +
  50 + - name: Publish wheels to PyPI
  51 + env:
  52 + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  53 + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  54 + run: |
  55 + python3 -m pip install --upgrade pip
  56 + python3 -m pip install wheel twine setuptools
  57 +
  58 + twine upload ./wheelhouse/*.whl