Fangjun Kuang
Committed by GitHub

Build pre-compiled wheels for aarch64 (Linux) (#197)

  1 +name: build-wheels-aarch64
  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-aarch64-${{ github.ref }}
  15 + cancel-in-progress: true
  16 +
  17 +jobs:
  18 + build_wheels_aarch64:
  19 + name: Build wheels for aarch64 on ${{ matrix.os }}
  20 + runs-on: ${{ matrix.os }}
  21 + strategy:
  22 + fail-fast: false
  23 + matrix:
  24 + os: [ubuntu-latest]
  25 +
  26 + steps:
  27 + - uses: actions/checkout@v2
  28 +
  29 + - name: Set up QEMU
  30 + uses: docker/setup-qemu-action@v2
  31 + with:
  32 + platforms: all
  33 +
  34 + # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
  35 + # for a list of versions
  36 + - name: Build wheels
  37 + uses: pypa/cibuildwheel@v2.11.4
  38 + env:
  39 + CIBW_BEFORE_BUILD: "pip install -U cmake numpy"
  40 + CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
  41 + CIBW_BUILD_VERBOSITY: 3
  42 + CIBW_ARCHS_LINUX: aarch64
  43 +
  44 + - name: Display wheels
  45 + shell: bash
  46 + run: |
  47 + ls -lh ./wheelhouse/
  48 +
  49 + ls -lh ./wheelhouse/*.whl
  50 +
  51 + - uses: actions/upload-artifact@v2
  52 + with:
  53 + path: ./wheelhouse/*.whl
  54 +
  55 + - name: Publish wheels to PyPI
  56 + env:
  57 + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  58 + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  59 + run: |
  60 + python3 -m pip install --upgrade pip
  61 + python3 -m pip install wheel twine setuptools
  62 +
  63 + twine upload ./wheelhouse/*.whl
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 # 4 #
5 # Please see the end of this file for what files it will generate 5 # Please see the end of this file for what files it will generate
6 6
  7 +set -ex
7 SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) 8 SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
8 echo "SHERPA_ONNX_VERSION: ${SHERPA_ONNX_VERSION}" 9 echo "SHERPA_ONNX_VERSION: ${SHERPA_ONNX_VERSION}"
9 dst=v${SHERPA_ONNX_VERSION} 10 dst=v${SHERPA_ONNX_VERSION}