Fangjun Kuang
Committed by GitHub

Refactor building wheels (#436)

@@ -142,7 +142,7 @@ jobs: @@ -142,7 +142,7 @@ jobs:
142 shell: bash 142 shell: bash
143 run: | 143 run: |
144 export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH 144 export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH
145 - aarch64-none-linux-gnu-strip --version 145 + aarch64-linux-gnu-strip --version
146 146
147 SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) 147 SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
148 148
@@ -157,7 +157,7 @@ jobs: @@ -157,7 +157,7 @@ jobs:
157 157
158 ls -lh $dst/bin/ 158 ls -lh $dst/bin/
159 echo "strip" 159 echo "strip"
160 - aarch64-none-linux-gnu-strip $dst/bin/* 160 + aarch64-linux-gnu-strip $dst/bin/*
161 161
162 tree $dst 162 tree $dst
163 163
@@ -17,12 +17,13 @@ concurrency: @@ -17,12 +17,13 @@ concurrency:
17 17
18 jobs: 18 jobs:
19 build_wheels_aarch64: 19 build_wheels_aarch64:
20 - name: Build wheels for aarch64 on ${{ matrix.os }} 20 + name: ${{ matrix.python-version }}
21 runs-on: ${{ matrix.os }} 21 runs-on: ${{ matrix.os }}
22 strategy: 22 strategy:
23 fail-fast: false 23 fail-fast: false
24 matrix: 24 matrix:
25 os: [ubuntu-latest] 25 os: [ubuntu-latest]
  26 + python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"]
26 27
27 steps: 28 steps:
28 - uses: actions/checkout@v4 29 - uses: actions/checkout@v4
@@ -35,9 +36,9 @@ jobs: @@ -35,9 +36,9 @@ jobs:
35 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ 36 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
36 # for a list of versions 37 # for a list of versions
37 - name: Build wheels 38 - name: Build wheels
38 - uses: pypa/cibuildwheel@v2.11.4 39 + uses: pypa/cibuildwheel@v2.15.0
39 env: 40 env:
40 - CIBW_BEFORE_BUILD: "pip install -U cmake numpy" 41 + CIBW_BUILD: "${{ matrix.python-version}}-* "
41 CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686" 42 CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
42 CIBW_BUILD_VERBOSITY: 3 43 CIBW_BUILD_VERBOSITY: 3
43 CIBW_ARCHS_LINUX: aarch64 44 CIBW_ARCHS_LINUX: aarch64
@@ -45,6 +45,7 @@ jobs: @@ -45,6 +45,7 @@ jobs:
45 echo PYTHON_VERSION=$PYTHON_VERSION >> $GITHUB_ENV 45 echo PYTHON_VERSION=$PYTHON_VERSION >> $GITHUB_ENV
46 46
47 # https://github.com/mshr-h/onnx-dockerfile-for-raspberry-pi/blob/main/3.10-bullseye-build/Dockerfile.arm32v7 47 # https://github.com/mshr-h/onnx-dockerfile-for-raspberry-pi/blob/main/3.10-bullseye-build/Dockerfile.arm32v7
  48 + # https://hub.docker.com/r/balenalib/raspberrypi3-python
48 - name: Run docker 49 - name: Run docker
49 uses: addnab/docker-run-action@v3 50 uses: addnab/docker-run-action@v3
50 with: 51 with:
1 -name: build-wheels 1 +name: build-wheels-linux
2 2
3 on: 3 on:
4 push: 4 push:
@@ -16,13 +16,14 @@ concurrency: @@ -16,13 +16,14 @@ concurrency:
16 cancel-in-progress: true 16 cancel-in-progress: true
17 17
18 jobs: 18 jobs:
19 - build_wheels:  
20 - name: Build wheels on ${{ matrix.os }} 19 + build_wheels_linux:
  20 + name: ${{ matrix.python-version }}
21 runs-on: ${{ matrix.os }} 21 runs-on: ${{ matrix.os }}
22 strategy: 22 strategy:
23 fail-fast: false 23 fail-fast: false
24 matrix: 24 matrix:
25 - os: [ubuntu-latest, windows-latest] 25 + os: [ubuntu-latest]
  26 + python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"]
26 27
27 steps: 28 steps:
28 - uses: actions/checkout@v4 29 - uses: actions/checkout@v4
@@ -30,9 +31,9 @@ jobs: @@ -30,9 +31,9 @@ jobs:
30 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ 31 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
31 # for a list of versions 32 # for a list of versions
32 - name: Build wheels 33 - name: Build wheels
33 - uses: pypa/cibuildwheel@v2.11.4 34 + uses: pypa/cibuildwheel@v2.15.0
34 env: 35 env:
35 - CIBW_BEFORE_BUILD: "pip install -U cmake numpy" 36 + CIBW_BUILD: "${{ matrix.python-version}}-* "
36 CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686" 37 CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
37 CIBW_BUILD_VERBOSITY: 3 38 CIBW_BUILD_VERBOSITY: 3
38 CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH='/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib' 39 CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH='/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib'
@@ -65,6 +66,35 @@ jobs: @@ -65,6 +66,35 @@ jobs:
65 with: 66 with:
66 path: ./wheelhouse/*.whl 67 path: ./wheelhouse/*.whl
67 68
  69 + - name: Publish to huggingface
  70 + if: matrix.python-version == 'cp38'
  71 + env:
  72 + HF_TOKEN: ${{ secrets.HF_TOKEN }}
  73 + uses: nick-fields/retry@v2
  74 + with:
  75 + max_attempts: 20
  76 + timeout_seconds: 200
  77 + shell: bash
  78 + command: |
  79 + git config --global user.email "csukuangfj@gmail.com"
  80 + git config --global user.name "Fangjun Kuang"
  81 +
  82 + rm -rf huggingface
  83 + export GIT_LFS_SKIP_SMUDGE=1
  84 +
  85 + git clone https://huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface
  86 + cd huggingface
  87 + git fetch
  88 + git pull
  89 + git merge -m "merge remote" --ff origin main
  90 +
  91 + cp -v ../wheelhouse/*.whl .
  92 +
  93 + git status
  94 + git add .
  95 + git commit -m "add more wheels"
  96 + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main
  97 +
68 - name: Publish wheels to PyPI 98 - name: Publish wheels to PyPI
69 env: 99 env:
70 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 100 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
@@ -76,14 +106,14 @@ jobs: @@ -76,14 +106,14 @@ jobs:
76 twine upload ./wheelhouse/*.whl 106 twine upload ./wheelhouse/*.whl
77 107
78 - name: Build sdist 108 - name: Build sdist
79 - if: ${{ matrix.os == 'ubuntu-latest' }} 109 + if: matrix.python-version == 'cp38'
80 shell: bash 110 shell: bash
81 run: | 111 run: |
82 python3 setup.py sdist 112 python3 setup.py sdist
83 ls -l dist/* 113 ls -l dist/*
84 114
85 - name: Publish sdist to PyPI 115 - name: Publish sdist to PyPI
86 - if: ${{ matrix.os == 'ubuntu-latest' }} 116 + if: matrix.python-version == 'cp38'
87 env: 117 env:
88 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 118 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
89 TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} 119 TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
1 -name: build-wheels-macos 1 +name: build-wheels-macos-arm64
2 2
3 on: 3 on:
4 push: 4 push:
@@ -12,17 +12,18 @@ env: @@ -12,17 +12,18 @@ env:
12 SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 12 SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
13 13
14 concurrency: 14 concurrency:
15 - group: build-wheels-macos-${{ github.ref }} 15 + group: build-wheels-macos-arm64-${{ github.ref }}
16 cancel-in-progress: true 16 cancel-in-progress: true
17 17
18 jobs: 18 jobs:
19 build_wheels: 19 build_wheels:
20 - name: Build wheels on ${{ matrix.os }} 20 + name: ${{ matrix.python-version }}
21 runs-on: ${{ matrix.os }} 21 runs-on: ${{ matrix.os }}
22 strategy: 22 strategy:
23 fail-fast: false 23 fail-fast: false
24 matrix: 24 matrix:
25 os: [macos-latest] 25 os: [macos-latest]
  26 + python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"]
26 27
27 steps: 28 steps:
28 - uses: actions/checkout@v4 29 - uses: actions/checkout@v4
@@ -30,11 +31,23 @@ jobs: @@ -30,11 +31,23 @@ jobs:
30 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ 31 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
31 # for a list of versions 32 # for a list of versions
32 - name: Build wheels 33 - name: Build wheels
  34 + if: matrix.python-version == 'cp37'
33 uses: pypa/cibuildwheel@v2.11.4 35 uses: pypa/cibuildwheel@v2.11.4
34 env: 36 env:
35 - CIBW_BEFORE_BUILD: "pip install -U cmake numpy"  
36 - CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64'"  
37 - CIBW_ARCHS: "universal2" 37 + CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64'"
  38 + CIBW_ARCHS: "arm64"
  39 + CIBW_BUILD_VERBOSITY: 3
  40 +
  41 + # Don't repair macOS wheels
  42 + CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
  43 +
  44 + - name: Build wheels
  45 + if: matrix.python-version != 'cp37'
  46 + uses: pypa/cibuildwheel@v2.15.0
  47 + env:
  48 + CIBW_BUILD: "${{ matrix.python-version}}-* "
  49 + CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64'"
  50 + CIBW_ARCHS: "arm64"
38 CIBW_BUILD_VERBOSITY: 3 51 CIBW_BUILD_VERBOSITY: 3
39 52
40 # Don't repair macOS wheels 53 # Don't repair macOS wheels
@@ -51,6 +64,35 @@ jobs: @@ -51,6 +64,35 @@ jobs:
51 with: 64 with:
52 path: ./wheelhouse/*.whl 65 path: ./wheelhouse/*.whl
53 66
  67 + - name: Publish to huggingface
  68 + if: matrix.python-version == 'cp38'
  69 + env:
  70 + HF_TOKEN: ${{ secrets.HF_TOKEN }}
  71 + uses: nick-fields/retry@v2
  72 + with:
  73 + max_attempts: 20
  74 + timeout_seconds: 200
  75 + shell: bash
  76 + command: |
  77 + git config --global user.email "csukuangfj@gmail.com"
  78 + git config --global user.name "Fangjun Kuang"
  79 +
  80 + rm -rf huggingface
  81 + export GIT_LFS_SKIP_SMUDGE=1
  82 +
  83 + git clone https://huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface
  84 + cd huggingface
  85 + git fetch
  86 + git pull
  87 + git merge -m "merge remote" --ff origin main
  88 +
  89 + cp -v ../wheelhouse/*.whl .
  90 +
  91 + git status
  92 + git add .
  93 + git commit -m "add more wheels"
  94 + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main
  95 +
54 - name: Publish wheels to PyPI 96 - name: Publish wheels to PyPI
55 env: 97 env:
56 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 98 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  1 +name: build-wheels-macos-x64
  2 +
  3 +on:
  4 + push:
  5 + branches:
  6 + - wheel
  7 + tags:
  8 + - '*'
  9 + workflow_dispatch:
  10 +
  11 +env:
  12 + SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
  13 +
  14 +concurrency:
  15 + group: build-wheels-macos-x64-${{ github.ref }}
  16 + cancel-in-progress: true
  17 +
  18 +jobs:
  19 + build_wheels:
  20 + name: ${{ matrix.python-version }}
  21 + runs-on: ${{ matrix.os }}
  22 + strategy:
  23 + fail-fast: false
  24 + matrix:
  25 + os: [macos-latest]
  26 + python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"]
  27 +
  28 + steps:
  29 + - uses: actions/checkout@v4
  30 +
  31 + # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
  32 + # for a list of versions
  33 + - name: Build wheels
  34 + if: matrix.python-version == 'cp37'
  35 + uses: pypa/cibuildwheel@v2.11.4
  36 + env:
  37 + CIBW_BUILD: "${{ matrix.python-version}}-* "
  38 + CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='x86_64'"
  39 + CIBW_ARCHS: "x86_64"
  40 + CIBW_BUILD_VERBOSITY: 3
  41 +
  42 + # Don't repair macOS wheels
  43 + CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
  44 + - name: Build wheels
  45 + if: matrix.python-version != 'cp37'
  46 + uses: pypa/cibuildwheel@v2.15.0
  47 + env:
  48 + CIBW_BUILD: "${{ matrix.python-version}}-* "
  49 + CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='x86_64'"
  50 + CIBW_ARCHS: "x86_64"
  51 + CIBW_BUILD_VERBOSITY: 3
  52 +
  53 + # Don't repair macOS wheels
  54 + CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
  55 +
  56 + - name: Display wheels
  57 + shell: bash
  58 + run: |
  59 + ls -lh ./wheelhouse/
  60 +
  61 + ls -lh ./wheelhouse/*.whl
  62 +
  63 + - uses: actions/upload-artifact@v3
  64 + with:
  65 + path: ./wheelhouse/*.whl
  66 +
  67 + - name: Publish to huggingface
  68 + if: matrix.python-version == 'cp38'
  69 + env:
  70 + HF_TOKEN: ${{ secrets.HF_TOKEN }}
  71 + uses: nick-fields/retry@v2
  72 + with:
  73 + max_attempts: 20
  74 + timeout_seconds: 200
  75 + shell: bash
  76 + command: |
  77 + git config --global user.email "csukuangfj@gmail.com"
  78 + git config --global user.name "Fangjun Kuang"
  79 +
  80 + rm -rf huggingface
  81 + export GIT_LFS_SKIP_SMUDGE=1
  82 +
  83 + git clone https://huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface
  84 + cd huggingface
  85 + git fetch
  86 + git pull
  87 + git merge -m "merge remote" --ff origin main
  88 +
  89 + cp -v ../wheelhouse/*.whl .
  90 +
  91 + git status
  92 + git add .
  93 + git commit -m "add more wheels"
  94 + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main
  95 +
  96 + - name: Publish wheels to PyPI
  97 + env:
  98 + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  99 + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  100 + run: |
  101 + python3 -m pip install --upgrade pip
  102 + python3 -m pip install wheel twine setuptools
  103 +
  104 + twine upload ./wheelhouse/*.whl
@@ -17,12 +17,13 @@ concurrency: @@ -17,12 +17,13 @@ concurrency:
17 17
18 jobs: 18 jobs:
19 build_wheels_win32: 19 build_wheels_win32:
20 - name: Build wheels on ${{ matrix.os }} 20 + name: ${{ matrix.python-version }}
21 runs-on: ${{ matrix.os }} 21 runs-on: ${{ matrix.os }}
22 strategy: 22 strategy:
23 fail-fast: false 23 fail-fast: false
24 matrix: 24 matrix:
25 os: [windows-latest] 25 os: [windows-latest]
  26 + python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"]
26 27
27 steps: 28 steps:
28 - uses: actions/checkout@v4 29 - uses: actions/checkout@v4
@@ -30,10 +31,10 @@ jobs: @@ -30,10 +31,10 @@ jobs:
30 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ 31 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
31 # for a list of versions 32 # for a list of versions
32 - name: Build wheels 33 - name: Build wheels
33 - uses: pypa/cibuildwheel@v2.11.4 34 + uses: pypa/cibuildwheel@v2.15.0
34 env: 35 env:
35 - CIBW_BEFORE_BUILD: "pip install -U cmake numpy"  
36 CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-A Win32" 36 CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-A Win32"
  37 + CIBW_BUILD: "${{ matrix.python-version}}-* "
37 CIBW_SKIP: "*-win_amd64" 38 CIBW_SKIP: "*-win_amd64"
38 CIBW_BUILD_VERBOSITY: 3 39 CIBW_BUILD_VERBOSITY: 3
39 40
@@ -48,6 +49,35 @@ jobs: @@ -48,6 +49,35 @@ jobs:
48 with: 49 with:
49 path: ./wheelhouse/*.whl 50 path: ./wheelhouse/*.whl
50 51
  52 + - name: Publish to huggingface
  53 + if: matrix.python-version == 'cp38'
  54 + env:
  55 + HF_TOKEN: ${{ secrets.HF_TOKEN }}
  56 + uses: nick-fields/retry@v2
  57 + with:
  58 + max_attempts: 20
  59 + timeout_seconds: 200
  60 + shell: bash
  61 + command: |
  62 + git config --global user.email "csukuangfj@gmail.com"
  63 + git config --global user.name "Fangjun Kuang"
  64 +
  65 + rm -rf huggingface
  66 + export GIT_LFS_SKIP_SMUDGE=1
  67 +
  68 + git clone https://huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface
  69 + cd huggingface
  70 + git fetch
  71 + git pull
  72 + git merge -m "merge remote" --ff origin main
  73 +
  74 + cp -v ../wheelhouse/*.whl .
  75 +
  76 + git status
  77 + git add .
  78 + git commit -m "add more wheels"
  79 + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main
  80 +
51 - name: Publish wheels to PyPI 81 - name: Publish wheels to PyPI
52 env: 82 env:
53 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 83 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  1 +name: build-wheels-win64
  2 +
  3 +on:
  4 + push:
  5 + branches:
  6 + - wheel
  7 + tags:
  8 + - '*'
  9 + workflow_dispatch:
  10 +
  11 +env:
  12 + SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
  13 +
  14 +concurrency:
  15 + group: build-wheels-win64-${{ github.ref }}
  16 + cancel-in-progress: true
  17 +
  18 +jobs:
  19 + build_wheels_win64:
  20 + name: ${{ matrix.python-version }}
  21 + runs-on: ${{ matrix.os }}
  22 + strategy:
  23 + fail-fast: false
  24 + matrix:
  25 + os: [windows-latest]
  26 + python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"]
  27 +
  28 + steps:
  29 + - uses: actions/checkout@v4
  30 +
  31 + # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
  32 + # for a list of versions
  33 + - name: Build wheels
  34 + uses: pypa/cibuildwheel@v2.15.0
  35 + env:
  36 + CIBW_BUILD: "${{ matrix.python-version}}-* "
  37 + CIBW_SKIP: "cp27-* cp35-* *-win32 pp* *-musllinux*"
  38 + CIBW_BUILD_VERBOSITY: 3
  39 +
  40 + - name: Display wheels
  41 + shell: bash
  42 + run: |
  43 + ls -lh ./wheelhouse/
  44 +
  45 + ls -lh ./wheelhouse/*.whl
  46 +
  47 + - uses: actions/upload-artifact@v3
  48 + with:
  49 + path: ./wheelhouse/*.whl
  50 +
  51 + - name: Publish to huggingface
  52 + if: matrix.python-version == 'cp38'
  53 + env:
  54 + HF_TOKEN: ${{ secrets.HF_TOKEN }}
  55 + uses: nick-fields/retry@v2
  56 + with:
  57 + max_attempts: 20
  58 + timeout_seconds: 200
  59 + shell: bash
  60 + command: |
  61 + git config --global user.email "csukuangfj@gmail.com"
  62 + git config --global user.name "Fangjun Kuang"
  63 +
  64 + rm -rf huggingface
  65 + export GIT_LFS_SKIP_SMUDGE=1
  66 +
  67 + git clone https://huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface
  68 + cd huggingface
  69 + git fetch
  70 + git pull
  71 + git merge -m "merge remote" --ff origin main
  72 +
  73 + cp -v ../wheelhouse/*.whl .
  74 +
  75 + git status
  76 + git add .
  77 + git commit -m "add more wheels"
  78 + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main
  79 +
  80 + - name: Publish to huggingface
  81 + if: matrix.python-version == 'cp38'
  82 + env:
  83 + HF_TOKEN: ${{ secrets.HF_TOKEN }}
  84 + uses: nick-fields/retry@v2
  85 + with:
  86 + max_attempts: 20
  87 + timeout_seconds: 200
  88 + shell: bash
  89 + command: |
  90 + git config --global user.email "csukuangfj@gmail.com"
  91 + git config --global user.name "Fangjun Kuang"
  92 +
  93 + rm -rf huggingface
  94 + export GIT_LFS_SKIP_SMUDGE=1
  95 +
  96 + git clone https://huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface
  97 + cd huggingface
  98 + git fetch
  99 + git pull
  100 + git merge -m "merge remote" --ff origin main
  101 +
  102 + cp -v ../wheelhouse/*.whl .
  103 +
  104 + git status
  105 + git add .
  106 + git commit -m "add more wheels"
  107 + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main
  108 +
  109 + - name: Publish wheels to PyPI
  110 + env:
  111 + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  112 + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  113 + run: |
  114 + python3 -m pip install --upgrade pip
  115 + python3 -m pip install wheel twine setuptools
  116 +
  117 + twine upload ./wheelhouse/*.whl