Committed by
GitHub
Fix publishing macos pre-built artifacts (#1922)
正在显示
1 个修改的文件
包含
41 行增加
和
28 行删除
| @@ -112,6 +112,12 @@ jobs: | @@ -112,6 +112,12 @@ jobs: | ||
| 112 | 112 | ||
| 113 | file ./bin/sherpa-onnx | 113 | file ./bin/sherpa-onnx |
| 114 | 114 | ||
| 115 | + rm -fv ./install/include/cargs.h | ||
| 116 | + rm -fv ./install/lib/cargs.h | ||
| 117 | + rm -fv ./install/lib/libcargs.dylib | ||
| 118 | + rm -fv ./install/lib/libcargs.a | ||
| 119 | + rm -rfv ./install/lib/pkgconfig | ||
| 120 | + | ||
| 115 | - name: Display dependencies of sherpa-onnx for macos | 121 | - name: Display dependencies of sherpa-onnx for macos |
| 116 | shell: bash | 122 | shell: bash |
| 117 | run: | | 123 | run: | |
| @@ -119,6 +125,41 @@ jobs: | @@ -119,6 +125,41 @@ jobs: | ||
| 119 | otool -L build/bin/sherpa-onnx | 125 | otool -L build/bin/sherpa-onnx |
| 120 | otool -l build/bin/sherpa-onnx | 126 | otool -l build/bin/sherpa-onnx |
| 121 | 127 | ||
| 128 | + - name: Copy files | ||
| 129 | + if: matrix.build_type == 'Release' | ||
| 130 | + shell: bash | ||
| 131 | + run: | | ||
| 132 | + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 133 | + | ||
| 134 | + if [[ ${{ matrix.with_tts }} == ON ]]; then | ||
| 135 | + dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-osx-universal2-${{ matrix.lib_type }} | ||
| 136 | + else | ||
| 137 | + dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-osx-universal2-${{ matrix.lib_type }}-no-tts | ||
| 138 | + fi | ||
| 139 | + mkdir $dst | ||
| 140 | + | ||
| 141 | + cp -a build/install/bin $dst/ | ||
| 142 | + if [[ ${{ matrix.lib_type }} == shared ]]; then | ||
| 143 | + mkdir $dst/lib | ||
| 144 | + cp -a build/install/lib/*.dylib* $dst/lib/ | ||
| 145 | + else | ||
| 146 | + cp -a build/install/lib $dst/ | ||
| 147 | + fi | ||
| 148 | + cp -a build/install/include $dst/ | ||
| 149 | + | ||
| 150 | + brew install tree | ||
| 151 | + tree $dst | ||
| 152 | + | ||
| 153 | + tar cjvf ${dst}.tar.bz2 $dst | ||
| 154 | + | ||
| 155 | + - name: Release pre-compiled binaries and libs for macOS | ||
| 156 | + if: matrix.build_type == 'Release' && (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
| 157 | + uses: svenstaro/upload-release-action@v2 | ||
| 158 | + with: | ||
| 159 | + file_glob: true | ||
| 160 | + overwrite: true | ||
| 161 | + file: sherpa-onnx-*osx-universal2*.tar.bz2 | ||
| 162 | + | ||
| 122 | - name: Test offline TTS | 163 | - name: Test offline TTS |
| 123 | if: matrix.with_tts == 'ON' | 164 | if: matrix.with_tts == 'ON' |
| 124 | shell: bash | 165 | shell: bash |
| @@ -266,32 +307,4 @@ jobs: | @@ -266,32 +307,4 @@ jobs: | ||
| 266 | 307 | ||
| 267 | .github/scripts/test-online-transducer.sh | 308 | .github/scripts/test-online-transducer.sh |
| 268 | 309 | ||
| 269 | - - name: Copy files | ||
| 270 | - if: matrix.build_type == 'Release' | ||
| 271 | - shell: bash | ||
| 272 | - run: | | ||
| 273 | - SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 274 | - | ||
| 275 | - if [[ ${{ matrix.with_tts }} == ON ]]; then | ||
| 276 | - dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-osx-universal2-${{ matrix.lib_type }} | ||
| 277 | - else | ||
| 278 | - dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-osx-universal2-${{ matrix.lib_type }}-no-tts | ||
| 279 | - fi | ||
| 280 | - mkdir $dst | ||
| 281 | - | ||
| 282 | - cp -a build/install/bin $dst/ | ||
| 283 | - cp -a build/install/lib $dst/ | ||
| 284 | - cp -a build/install/include $dst/ | ||
| 285 | - | ||
| 286 | - brew install tree | ||
| 287 | - tree $dst | ||
| 288 | - | ||
| 289 | - tar cjvf ${dst}.tar.bz2 $dst | ||
| 290 | 310 | ||
| 291 | - - name: Release pre-compiled binaries and libs for macOS | ||
| 292 | - if: matrix.build_type == 'Release' && (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
| 293 | - uses: svenstaro/upload-release-action@v2 | ||
| 294 | - with: | ||
| 295 | - file_glob: true | ||
| 296 | - overwrite: true | ||
| 297 | - file: sherpa-onnx-*osx-universal2*.tar.bz2 |
-
请 注册 或 登录 后发表评论