build-wheels-aarch64.yaml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. name: build-wheels-aarch64
  2. on:
  3. push:
  4. branches:
  5. - wheel
  6. tags:
  7. - '*'
  8. workflow_dispatch:
  9. env:
  10. SHERPA_NCNN_IS_IN_GITHUB_ACTIONS: 1
  11. concurrency:
  12. group: build-wheels-aarch64-${{ github.ref }}
  13. cancel-in-progress: true
  14. jobs:
  15. build_wheels_aarch64:
  16. name: ${{ matrix.python-version }}
  17. runs-on: ${{ matrix.os }}
  18. strategy:
  19. fail-fast: false
  20. matrix:
  21. os: [ubuntu-latest]
  22. python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"]
  23. steps:
  24. - uses: actions/checkout@v4
  25. - name: Set up QEMU
  26. uses: docker/setup-qemu-action@v2
  27. with:
  28. platforms: all
  29. # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
  30. # for a list of versions
  31. - name: Build wheels
  32. uses: pypa/cibuildwheel@v2.15.0
  33. env:
  34. CIBW_BEFORE_ALL: |
  35. git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib
  36. cd alsa-lib
  37. ./gitcompile
  38. cd ..
  39. echo "PWD"
  40. ls -lh /project/alsa-lib/src/.libs
  41. CIBW_ENVIRONMENT: CPLUS_INCLUDE_PATH=/project/alsa-lib/include:$CPLUS_INCLUDE_PATH SHERPA_NCNN_ALSA_LIB_DIR=/project/alsa-lib/src/.libs LD_LIBRARY_PATH=/project/build/bdist.linux-x86_64/wheel/sherpa_ncnn/lib:$SHERPA_NCNN_ALSA_LIB_DIR SHERPA_NCNN_MAKE_ARGS="VERBOSE=1" SHERPA_NCNN_ENABLE_ALSA=1 SHERPA_NCNN_CMAKE_ARGS='-DCMAKE_C_FLAGS="-march=armv8-a" -DCMAKE_CXX_FLAGS="-march=armv8-a"'
  42. CIBW_BUILD: "${{ matrix.python-version}}-* "
  43. CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
  44. CIBW_BUILD_VERBOSITY: 3
  45. CIBW_ARCHS_LINUX: aarch64
  46. - name: Display wheels
  47. shell: bash
  48. run: |
  49. ls -lh ./wheelhouse/
  50. - uses: actions/upload-artifact@v4
  51. with:
  52. name: ${{ matrix.python-version }}
  53. path: ./wheelhouse/*.whl
  54. - name: Publish wheels to PyPI
  55. env:
  56. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  57. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  58. run: |
  59. python3 -m pip install --upgrade pip
  60. python3 -m pip install wheel twine setuptools
  61. twine upload ./wheelhouse/*.whl