Fangjun Kuang
Committed by GitHub

Fix CI for Linux aarch64. (#1822)

@@ -37,13 +37,13 @@ jobs: @@ -37,13 +37,13 @@ jobs:
37 fail-fast: false 37 fail-fast: false
38 matrix: 38 matrix:
39 include: 39 include:
40 - - os: ubuntu-latest 40 + - os: ubuntu-22.04-arm
41 gpu: ON 41 gpu: ON
42 onnxruntime_version: "1.11.0" 42 onnxruntime_version: "1.11.0"
43 - - os: ubuntu-latest 43 + - os: ubuntu-22.04-arm
44 gpu: ON 44 gpu: ON
45 onnxruntime_version: "1.16.0" 45 onnxruntime_version: "1.16.0"
46 - - os: ubuntu-latest 46 + - os: ubuntu-22.04-arm
47 gpu: OFF 47 gpu: OFF
48 onnxruntime_version: "" 48 onnxruntime_version: ""
49 49
@@ -52,154 +52,107 @@ jobs: @@ -52,154 +52,107 @@ jobs:
52 with: 52 with:
53 fetch-depth: 0 53 fetch-depth: 0
54 54
55 - - name: ccache  
56 - uses: hendrikmuhs/ccache-action@v1.2  
57 - with:  
58 - key: ${{ matrix.os }}-aarch64-shared  
59 -  
60 - - name: cache-qemu  
61 - id: cache-qemu  
62 - uses: actions/cache@v4  
63 - with:  
64 - path: qemu-install  
65 - key: qemu-aarch64-install-20220908  
66 -  
67 - - name: install-qemu-build-deps  
68 - if: steps.cache-qemu.outputs.cache-hit != 'true' 55 + - name: Build sherpa-onnx
  56 + if: matrix.gpu == 'ON'
  57 + shell: bash
69 run: | 58 run: |
70 - sudo apt-get update  
71 - sudo apt-get install autoconf automake autotools-dev ninja-build libglib2.0-dev.  
72 -  
73 - - name: checkout-qemu  
74 - if: steps.cache-qemu.outputs.cache-hit != 'true'  
75 - uses: actions/checkout@v3 59 + onnxruntime_version=${{ matrix.onnxruntime_version }}
  60 +
  61 + git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib
  62 + pushd alsa-lib
  63 + ./gitcompile
  64 + popd
  65 +
  66 + export CPLUS_INCLUDE_PATH=$PWD/alsa-lib/include:$CPLUS_INCLUDE_PATH
  67 + export SHERPA_ONNX_ALSA_LIB_DIR=$PWD/alsa-lib/src/.libs
  68 +
  69 + mkdir build
  70 + cd build
  71 + cmake \
  72 + -DBUILD_SHARED_LIBS=ON \
  73 + -DCMAKE_INSTALL_PREFIX=./install \
  74 + -DSHERPA_ONNX_ENABLE_GPU=ON \
  75 + -DSHERPA_ONNX_LINUX_ARM64_GPU_ONNXRUNTIME_VERSION=$onnxruntime_version \
  76 + ..
  77 + make -j4 install
  78 +
  79 + rm -rf install/lib/pkgconfig
  80 + rm -fv install/lib/cargs.h
  81 + rm -fv install/lib/libcargs.so
  82 +
  83 + - name: Build sherpa-onnx
  84 + if: matrix.gpu == 'OFF'
  85 + uses: addnab/docker-run-action@v3
76 with: 86 with:
77 - repository: qemu/qemu  
78 - path: qemu  
79 - ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 87 + image: quay.io/pypa/manylinux2014_aarch64
  88 + options: |
  89 + --volume ${{ github.workspace }}/:/k2-fsa/sherpa-onnx
  90 + shell: bash
  91 + run: |
  92 + echo "config: ${{ matrix.config }}"
  93 + uname -a
  94 + which gcc
80 95
81 - - name: qemu  
82 - if: steps.cache-qemu.outputs.cache-hit != 'true'  
83 - run: |  
84 - cd qemu  
85 - ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system  
86 - make -j2  
87 - make install 96 + gcc --version
  97 + g++ --version
88 98
89 - - name: cache-toolchain (CPU)  
90 - if: matrix.gpu == 'OFF'  
91 - id: cache-toolchain-cpu  
92 - uses: actions/cache@v4  
93 - with:  
94 - path: toolchain  
95 - key: gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz 99 + echo "pwd"
96 100
97 - - name: cache-toolchain (GPU)  
98 - if: matrix.gpu == 'ON'  
99 - id: cache-toolchain-gpu  
100 - uses: actions/cache@v4  
101 - with:  
102 - path: toolchain  
103 - key: gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz 101 + ls -lh
104 102
105 - - name: Download toolchain (CPU, gcc 7.5)  
106 - if: steps.cache-toolchain-cpu.outputs.cache-hit != 'true' && matrix.gpu == 'OFF'  
107 - shell: bash  
108 - run: |  
109 - wget -qq https://huggingface.co/csukuangfj/sherpa-ncnn-toolchains/resolve/main/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz 103 + cd /k2-fsa/sherpa-onnx/
110 104
111 - mkdir $GITHUB_WORKSPACE/toolchain  
112 - tar xf ./gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz --strip-components 1 -C $GITHUB_WORKSPACE/toolchain 105 + git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib
  106 + pushd alsa-lib
  107 + ./gitcompile
  108 + popd
113 109
114 - - name: Download toolchain (GPU, gcc 10.3)  
115 - if: steps.cache-toolchain-gpu.outputs.cache-hit != 'true' && matrix.gpu == 'ON'  
116 - shell: bash  
117 - run: |  
118 - wget -qq https://huggingface.co/csukuangfj/sherpa-ncnn-toolchains/resolve/main/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz 110 + export CPLUS_INCLUDE_PATH=$PWD/alsa-lib/include:$CPLUS_INCLUDE_PATH
  111 + export SHERPA_ONNX_ALSA_LIB_DIR=$PWD/alsa-lib/src/.libs
119 112
120 - mkdir $GITHUB_WORKSPACE/toolchain  
121 - tar xf ./gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz --strip-components 1 -C $GITHUB_WORKSPACE/toolchain 113 + mkdir build
  114 + cd build
122 115
123 - - name: Set environment variable  
124 - if: steps.cache-build-result.outputs.cache-hit != 'true'  
125 - shell: bash  
126 - run: |  
127 - echo "$GITHUB_WORKSPACE/toolchain/bin" >> "$GITHUB_PATH"  
128 - echo "$GITHUB_WORKSPACE/bin" >> "$GITHUB_PATH"  
129 - ls -lh "$GITHUB_WORKSPACE/toolchain/bin" 116 + cmake \
  117 + -DBUILD_SHARED_LIBS=ON \
  118 + -DCMAKE_INSTALL_PREFIX=./install \
  119 + ..
130 120
131 - if [[ ${{ matrix.gpu }} == OFF ]]; then  
132 - echo "CC=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"  
133 - echo "CXX=aarch64-linux-gnu-g++" >> "$GITHUB_ENV"  
134 - else  
135 - echo "CC=aarch64-none-linux-gnu-gcc" >> "$GITHUB_ENV"  
136 - echo "CXX=aarch64-none-linux-gnu-g++" >> "$GITHUB_ENV"  
137 - fi 121 + make -j4 install
138 122
139 - - name: Display toolchain info  
140 - shell: bash  
141 - run: |  
142 - if [[ ${{ matrix.gpu }} == OFF ]]; then  
143 - which aarch64-linux-gnu-gcc  
144 - aarch64-linux-gnu-gcc --version  
145 - else  
146 - which aarch64-none-linux-gnu-gcc  
147 - aarch64-none-linux-gnu-gcc --version  
148 - fi 123 + rm -rf install/lib/pkgconfig
  124 + rm -fv install/lib/cargs.h
  125 + rm -fv install/lib/libcargs.so
149 126
150 - - name: Display qemu-aarch64 -h 127 + - name: Display system info
151 shell: bash 128 shell: bash
152 run: | 129 run: |
153 - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH  
154 - export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-linux-gnu/libc  
155 - export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-none-linux-gnu/libc  
156 - qemu-aarch64 -h 130 + uname -a
  131 + gcc --version
  132 + g++ --version
157 133
158 - - name: build aarch64-linux-gnu 134 + - name: Display generated files
159 shell: bash 135 shell: bash
160 run: | 136 run: |
161 - export CMAKE_CXX_COMPILER_LAUNCHER=ccache  
162 - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" 137 + cd build/install
163 138
164 - cmake --version 139 + ls -lh bin
165 140
166 - export BUILD_SHARED_LIBS=ON  
167 - export SHERPA_ONNX_ENABLE_GPU=${{ matrix.gpu }}  
168 - export SHERPA_ONNX_LINUX_ARM64_GPU_ONNXRUNTIME_VERSION=${{ matrix.onnxruntime_version }} 141 + echo "---"
169 142
170 - ./build-aarch64-linux-gnu.sh 143 + ls -lh lib
171 144
172 - ls -lh build-aarch64-linux-gnu/bin  
173 - ls -lh build-aarch64-linux-gnu/lib 145 + file bin/sherpa-onnx
174 146
175 - file build-aarch64-linux-gnu/bin/sherpa-onnx 147 + readelf -d bin/sherpa-onnx
176 148
177 - - name: Test sherpa-onnx  
178 - shell: bash  
179 - run: |  
180 - export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH  
181 - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH  
182 - if [[ ${{ matrix.gpu }} == OFF ]]; then  
183 - export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-linux-gnu/libc  
184 - else  
185 - export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-none-linux-gnu/libc  
186 - fi 149 + ldd bin/sherpa-onnx
187 150
188 - ls -lh ./build-aarch64-linux-gnu/bin  
189 -  
190 - qemu-aarch64 ./build-aarch64-linux-gnu/bin/sherpa-onnx --help  
191 -  
192 - readelf -d ./build-aarch64-linux-gnu/bin/sherpa-onnx 151 + ./bin/sherpa-onnx --help
193 152
194 - name: Copy files 153 - name: Copy files
195 shell: bash 154 shell: bash
196 run: | 155 run: |
197 - if [[ ${{ matrix.gpu }} == OFF ]]; then  
198 - aarch64-linux-gnu-strip --version  
199 - else  
200 - aarch64-none-linux-gnu-strip --version  
201 - fi  
202 -  
203 SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) 156 SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
204 157
205 dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-aarch64-shared 158 dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-aarch64-shared
@@ -210,19 +163,18 @@ jobs: @@ -210,19 +163,18 @@ jobs:
210 fi 163 fi
211 mkdir $dst 164 mkdir $dst
212 165
213 - cp -a build-aarch64-linux-gnu/install/bin $dst/  
214 - cp -a build-aarch64-linux-gnu/install/lib $dst/ 166 + cp -a build/install/bin $dst/
  167 + cp -a build/install/lib $dst/
215 168
216 - ls -lh build-aarch64-linux-gnu/install/lib  
217 - ls -lh build-aarch64-linux-gnu/install/bin 169 + ls -lh build/install/lib
  170 + ls -lh build/install/bin
218 171
219 ls -lh $dst/bin/ 172 ls -lh $dst/bin/
220 echo "strip" 173 echo "strip"
221 - if [[ ${{ matrix.gpu }} == OFF ]]; then  
222 - aarch64-linux-gnu-strip $dst/bin/*  
223 - else  
224 - aarch64-none-linux-gnu-strip $dst/bin/*  
225 - fi 174 + strip $dst/bin/*
  175 +
  176 + echo "after strip"
  177 + ls -lh $dst/bin/
226 178
227 tree $dst 179 tree $dst
228 180
@@ -266,9 +218,32 @@ jobs: @@ -266,9 +218,32 @@ jobs:
266 git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main 218 git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
267 219
268 - name: Release pre-compiled binaries and libs for aarch64 linux 220 - name: Release pre-compiled binaries and libs for aarch64 linux
269 - if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') 221 + if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
270 uses: svenstaro/upload-release-action@v2 222 uses: svenstaro/upload-release-action@v2
271 with: 223 with:
272 file_glob: true 224 file_glob: true
273 overwrite: true 225 overwrite: true
274 file: sherpa-onnx-*linux-aarch64*.tar.bz2 226 file: sherpa-onnx-*linux-aarch64*.tar.bz2
  227 +
  228 + - name: Release pre-compiled binaries and libs for aarch64 linux
  229 + if: github.repository_owner == 'csukuangfj' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
  230 + uses: svenstaro/upload-release-action@v2
  231 + with:
  232 + file_glob: true
  233 + overwrite: true
  234 + file: sherpa-onnx-*linux-aarch64*.tar.bz2
  235 + # repo_name: k2-fsa/sherpa-onnx
  236 + # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
  237 + # tag: v1.10.42
  238 +
  239 + - name: Test offline Moonshine
  240 + if: matrix.build_type != 'Debug'
  241 + shell: bash
  242 + run: |
  243 + du -h -d1 .
  244 + export PATH=$PWD/build/install/bin:$PATH
  245 + export EXE=sherpa-onnx-offline
  246 +
  247 + readelf -d build/bin/sherpa-onnx-offline
  248 +
  249 + .github/scripts/test-offline-moonshine.sh
@@ -36,125 +36,72 @@ jobs: @@ -36,125 +36,72 @@ jobs:
36 strategy: 36 strategy:
37 fail-fast: false 37 fail-fast: false
38 matrix: 38 matrix:
39 - os: [ubuntu-latest] 39 + os: [ubuntu-22.04-arm]
40 40
41 steps: 41 steps:
42 - uses: actions/checkout@v4 42 - uses: actions/checkout@v4
43 with: 43 with:
44 fetch-depth: 0 44 fetch-depth: 0
45 45
46 - - name: ccache  
47 - uses: hendrikmuhs/ccache-action@v1.2 46 + - name: Build sherpa-onnx
  47 + uses: addnab/docker-run-action@v3
48 with: 48 with:
49 - key: ${{ matrix.os }}-aarch64-static 49 + image: quay.io/pypa/manylinux2014_aarch64
  50 + options: |
  51 + --volume ${{ github.workspace }}/:/k2-fsa/sherpa-onnx
  52 + shell: bash
  53 + run: |
  54 + echo "config: ${{ matrix.config }}"
  55 + uname -a
  56 + which gcc
50 57
51 - - name: cache-qemu  
52 - id: cache-qemu  
53 - uses: actions/cache@v4  
54 - with:  
55 - path: qemu-install  
56 - key: qemu-aarch64-install-20220908  
57 -  
58 - - name: install-qemu-build-deps  
59 - if: steps.cache-qemu.outputs.cache-hit != 'true'  
60 - run: |  
61 - sudo apt-get update  
62 - sudo apt-get install build-essential zlib1g-dev pkg-config libglib2.0-dev binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev ninja-build  
63 -  
64 - - name: checkout-qemu  
65 - if: steps.cache-qemu.outputs.cache-hit != 'true'  
66 - uses: actions/checkout@v3  
67 - with:  
68 - repository: qemu/qemu  
69 - path: qemu  
70 - ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65  
71 -  
72 - - name: qemu  
73 - if: steps.cache-qemu.outputs.cache-hit != 'true'  
74 - run: |  
75 - cd qemu  
76 - ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system  
77 - make -j2  
78 - make install  
79 -  
80 - - name: cache-toolchain  
81 - id: cache-toolchain  
82 - uses: actions/cache@v4  
83 - with:  
84 - path: toolchain  
85 - key: gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz  
86 -  
87 - - name: Download toolchain  
88 - if: steps.cache-toolchain.outputs.cache-hit != 'true'  
89 - shell: bash  
90 - run: |  
91 - wget -qq https://huggingface.co/csukuangfj/sherpa-ncnn-toolchains/resolve/main/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz  
92 -  
93 - mkdir $GITHUB_WORKSPACE/toolchain  
94 - tar xf ./gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz --strip-components 1 -C $GITHUB_WORKSPACE/toolchain  
95 -  
96 - - name: Display toolchain info  
97 - shell: bash  
98 - run: |  
99 - export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH  
100 - aarch64-none-linux-gnu-gcc --version  
101 -  
102 - - name: Display qemu-aarch64 -h  
103 - shell: bash  
104 - run: |  
105 - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH  
106 - export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-none-linux-gnu/libc  
107 - qemu-aarch64 -h 58 + gcc --version
  59 + g++ --version
108 60
109 - - name: build aarch64-linux-gnu  
110 - shell: bash  
111 - run: |  
112 - export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH  
113 -  
114 - export CMAKE_CXX_COMPILER_LAUNCHER=ccache  
115 - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" 61 + echo "pwd"
116 62
117 - cmake --version 63 + ls -lh
118 64
119 - export BUILD_SHARED_LIBS=OFF 65 + cd /k2-fsa/sherpa-onnx/
120 66
121 - ./build-aarch64-linux-gnu.sh 67 + git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib
  68 + pushd alsa-lib
  69 + ./gitcompile
  70 + popd
122 71
123 - ls -lh build-aarch64-linux-gnu/bin  
124 - ls -lh build-aarch64-linux-gnu/lib 72 + export CPLUS_INCLUDE_PATH=$PWD/alsa-lib/include:$CPLUS_INCLUDE_PATH
  73 + export SHERPA_ONNX_ALSA_LIB_DIR=$PWD/alsa-lib/src/.libs
125 74
126 - file build-aarch64-linux-gnu/bin/sherpa-onnx 75 + mkdir build
  76 + cd build
  77 + cmake \
  78 + -DBUILD_SHARED_LIBS=OFF \
  79 + -DCMAKE_INSTALL_PREFIX=./install \
  80 + ..
127 81
128 - - name: Test sherpa-onnx  
129 - shell: bash  
130 - run: |  
131 - export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH  
132 - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH  
133 - export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-none-linux-gnu/libc 82 + make -j 4
134 83
135 - ls -lh ./build-aarch64-linux-gnu/bin 84 + make install
136 85
137 - qemu-aarch64 ./build-aarch64-linux-gnu/bin/sherpa-onnx --help 86 + ls -lh install/lib
138 87
139 - readelf -d ./build-aarch64-linux-gnu/bin/sherpa-onnx 88 + rm -rf install/lib/pkgconfig
  89 + rm -fv install/lib/cargs.h
140 90
141 - name: Copy files 91 - name: Copy files
142 shell: bash 92 shell: bash
143 run: | 93 run: |
144 - export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH  
145 - aarch64-none-linux-gnu-strip --version  
146 -  
147 SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) 94 SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
148 95
149 dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-aarch64-static 96 dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-aarch64-static
150 mkdir $dst 97 mkdir $dst
151 98
152 - ls -lh build-aarch64-linux-gnu/install/lib 99 + ls -lh build/install/lib
153 100
154 - cp -a build-aarch64-linux-gnu/install/bin $dst/ 101 + cp -a build/install/bin $dst/
155 ls -lh $dst/bin/ 102 ls -lh $dst/bin/
156 echo "strip" 103 echo "strip"
157 - aarch64-none-linux-gnu-strip $dst/bin/* 104 + strip $dst/bin/*
158 ls -lh $dst/bin/ 105 ls -lh $dst/bin/
159 106
160 tree $dst 107 tree $dst
@@ -199,9 +146,32 @@ jobs: @@ -199,9 +146,32 @@ jobs:
199 git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main 146 git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
200 147
201 - name: Release pre-compiled binaries and libs for aarch64 linux 148 - name: Release pre-compiled binaries and libs for aarch64 linux
202 - if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') 149 + if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
  150 + uses: svenstaro/upload-release-action@v2
  151 + with:
  152 + file_glob: true
  153 + overwrite: true
  154 + file: sherpa-onnx-*linux-aarch64*.tar.bz2
  155 +
  156 + - name: Release pre-compiled binaries and libs for aarch64 linux
  157 + if: github.repository_owner == 'csukuangfj' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
203 uses: svenstaro/upload-release-action@v2 158 uses: svenstaro/upload-release-action@v2
204 with: 159 with:
205 file_glob: true 160 file_glob: true
206 overwrite: true 161 overwrite: true
207 file: sherpa-onnx-*linux-aarch64*.tar.bz2 162 file: sherpa-onnx-*linux-aarch64*.tar.bz2
  163 + # repo_name: k2-fsa/sherpa-onnx
  164 + # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
  165 + # tag: v1.10.42
  166 +
  167 + - name: Test offline Moonshine
  168 + if: matrix.build_type != 'Debug'
  169 + shell: bash
  170 + run: |
  171 + du -h -d1 .
  172 + export PATH=$PWD/build/bin:$PATH
  173 + export EXE=sherpa-onnx-offline
  174 +
  175 + readelf -d build/bin/sherpa-onnx-offline
  176 +
  177 + .github/scripts/test-offline-moonshine.sh
@@ -19,7 +19,7 @@ jobs: @@ -19,7 +19,7 @@ jobs:
19 strategy: 19 strategy:
20 fail-fast: false 20 fail-fast: false
21 matrix: 21 matrix:
22 - os: [ubuntu-latest] 22 + os: [ubuntu-22.04-arm]
23 # java-version: ['8', '11', '16', '17', '21'] 23 # java-version: ['8', '11', '16', '17', '21']
24 java-version: ['21'] 24 java-version: ['21']
25 25
@@ -33,12 +33,6 @@ jobs: @@ -33,12 +33,6 @@ jobs:
33 distribution: 'temurin' # See 'Supported distributions' for available options 33 distribution: 'temurin' # See 'Supported distributions' for available options
34 java-version: ${{ matrix.java-version }} 34 java-version: ${{ matrix.java-version }}
35 35
36 - - name: Set up QEMU  
37 - if: steps.cache-build-result.outputs.cache-hit != 'true'  
38 - uses: docker/setup-qemu-action@v2  
39 - with:  
40 - platforms: all  
41 -  
42 - name: Display PWD 36 - name: Display PWD
43 shell: bash 37 shell: bash
44 run: | 38 run: |
@@ -167,10 +161,20 @@ jobs: @@ -167,10 +161,20 @@ jobs:
167 git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main 161 git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
168 162
169 - name: Release pre-compiled binaries and libs for linux aarch64 163 - name: Release pre-compiled binaries and libs for linux aarch64
170 - if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.java-version == '21' 164 + if: github.repository_owner == 'csukuangfj' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.java-version == '21'
171 uses: svenstaro/upload-release-action@v2 165 uses: svenstaro/upload-release-action@v2
172 with: 166 with:
173 file_glob: true 167 file_glob: true
174 overwrite: true 168 overwrite: true
175 file: sherpa-onnx-*.tar.bz2 169 file: sherpa-onnx-*.tar.bz2
  170 + # repo_name: k2-fsa/sherpa-onnx
  171 + # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
  172 + # tag: v1.10.42
176 173
  174 + - name: Release pre-compiled binaries and libs for linux aarch64
  175 + if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.java-version == '21'
  176 + uses: svenstaro/upload-release-action@v2
  177 + with:
  178 + file_glob: true
  179 + overwrite: true
  180 + file: sherpa-onnx-*.tar.bz2
1 /** 1 /**
2 * Use these variables when you tailor your ArkTS code. They must be of the const type. 2 * Use these variables when you tailor your ArkTS code. They must be of the const type.
3 */ 3 */
4 -export const HAR_VERSION = '1.10.41'; 4 +export const HAR_VERSION = '1.10.42';
5 export const BUILD_MODE_NAME = 'debug'; 5 export const BUILD_MODE_NAME = 'debug';
6 export const DEBUG = true; 6 export const DEBUG = true;
7 export const TARGET_NAME = 'default'; 7 export const TARGET_NAME = 'default';
@@ -146,7 +146,7 @@ static Napi::External<SherpaOnnxOfflineTts> CreateOfflineTtsWrapper( @@ -146,7 +146,7 @@ static Napi::External<SherpaOnnxOfflineTts> CreateOfflineTtsWrapper(
146 SHERPA_ONNX_ASSIGN_ATTR_STR(rule_fsts, ruleFsts); 146 SHERPA_ONNX_ASSIGN_ATTR_STR(rule_fsts, ruleFsts);
147 SHERPA_ONNX_ASSIGN_ATTR_INT32(max_num_sentences, maxNumSentences); 147 SHERPA_ONNX_ASSIGN_ATTR_INT32(max_num_sentences, maxNumSentences);
148 SHERPA_ONNX_ASSIGN_ATTR_STR(rule_fars, ruleFars); 148 SHERPA_ONNX_ASSIGN_ATTR_STR(rule_fars, ruleFars);
149 - SHERPA_ONNX_ASSIGN_ATTR_STR(silence_scale, silenceScale); 149 + SHERPA_ONNX_ASSIGN_ATTR_FLOAT(silence_scale, silenceScale);
150 150
151 #if __OHOS__ 151 #if __OHOS__
152 std::unique_ptr<NativeResourceManager, 152 std::unique_ptr<NativeResourceManager,