Committed by
GitHub
Upload pre-compiled binaries and libraries on release (#206)
正在显示
10 个修改的文件
包含
304 行增加
和
38 行删除
| @@ -5,6 +5,8 @@ on: | @@ -5,6 +5,8 @@ on: | ||
| 5 | push: | 5 | push: |
| 6 | branches: | 6 | branches: |
| 7 | - master | 7 | - master |
| 8 | + tags: | ||
| 9 | + - '*' | ||
| 8 | paths: | 10 | paths: |
| 9 | - '.github/workflows/aarch64-linux-gnu.yaml' | 11 | - '.github/workflows/aarch64-linux-gnu.yaml' |
| 10 | - 'CMakeLists.txt' | 12 | - 'CMakeLists.txt' |
| @@ -20,14 +22,25 @@ on: | @@ -20,14 +22,25 @@ on: | ||
| 20 | - 'cmake/**' | 22 | - 'cmake/**' |
| 21 | - 'sherpa-onnx/csrc/*' | 23 | - 'sherpa-onnx/csrc/*' |
| 22 | - 'toolchains/aarch64-linux-gnu.toolchain.cmake' | 24 | - 'toolchains/aarch64-linux-gnu.toolchain.cmake' |
| 25 | + release: | ||
| 26 | + types: | ||
| 27 | + - published | ||
| 28 | + | ||
| 29 | + workflow_dispatch: | ||
| 30 | + inputs: | ||
| 31 | + release: | ||
| 32 | + description: "Whether to release" | ||
| 33 | + type: boolean | ||
| 34 | + | ||
| 35 | +env: | ||
| 36 | + RELEASE: | ||
| 37 | + |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 38 | + ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 23 | 39 | ||
| 24 | concurrency: | 40 | concurrency: |
| 25 | group: aarch64-linux-gnu-${{ github.ref }} | 41 | group: aarch64-linux-gnu-${{ github.ref }} |
| 26 | cancel-in-progress: true | 42 | cancel-in-progress: true |
| 27 | 43 | ||
| 28 | -permissions: | ||
| 29 | - contents: read | ||
| 30 | - | ||
| 31 | jobs: | 44 | jobs: |
| 32 | aarch64_linux_gnu: | 45 | aarch64_linux_gnu: |
| 33 | runs-on: ${{ matrix.os }} | 46 | runs-on: ${{ matrix.os }} |
| @@ -118,7 +131,31 @@ jobs: | @@ -118,7 +131,31 @@ jobs: | ||
| 118 | export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH | 131 | export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH |
| 119 | export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-linux-gnu/libc | 132 | export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-linux-gnu/libc |
| 120 | 133 | ||
| 121 | - | ||
| 122 | ls -lh ./build-aarch64-linux-gnu/bin | 134 | ls -lh ./build-aarch64-linux-gnu/bin |
| 123 | 135 | ||
| 124 | qemu-aarch64 ./build-aarch64-linux-gnu/bin/sherpa-onnx --help | 136 | qemu-aarch64 ./build-aarch64-linux-gnu/bin/sherpa-onnx --help |
| 137 | + | ||
| 138 | + - name: Copy files | ||
| 139 | + if: env.RELEASE == 'true' | ||
| 140 | + shell: bash | ||
| 141 | + run: | | ||
| 142 | + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 143 | + | ||
| 144 | + dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-aarch64 | ||
| 145 | + mkdir $dst | ||
| 146 | + | ||
| 147 | + cp -a build-aarch64-linux-gnu/install/bin $dst/ | ||
| 148 | + cp -a build-aarch64-linux-gnu/install/lib $dst/ | ||
| 149 | + cp -a build-aarch64-linux-gnu/install/include $dst/ | ||
| 150 | + | ||
| 151 | + tree $dst | ||
| 152 | + | ||
| 153 | + tar cjvf ${dst}.tar.bz2 $dst | ||
| 154 | + | ||
| 155 | + - name: Release pre-compiled binaries and libs for aarch64 linux | ||
| 156 | + if: env.RELEASE == 'true' | ||
| 157 | + uses: svenstaro/upload-release-action@v2 | ||
| 158 | + with: | ||
| 159 | + file_glob: true | ||
| 160 | + overwrite: true | ||
| 161 | + file: sherpa-onnx-*linux-aarch64.tar.bz2 |
| @@ -20,14 +20,25 @@ on: | @@ -20,14 +20,25 @@ on: | ||
| 20 | - 'cmake/**' | 20 | - 'cmake/**' |
| 21 | - 'sherpa-onnx/csrc/*' | 21 | - 'sherpa-onnx/csrc/*' |
| 22 | - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' | 22 | - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' |
| 23 | + release: | ||
| 24 | + types: | ||
| 25 | + - published | ||
| 26 | + | ||
| 27 | + workflow_dispatch: | ||
| 28 | + inputs: | ||
| 29 | + release: | ||
| 30 | + description: "Whether to release" | ||
| 31 | + type: boolean | ||
| 32 | + | ||
| 33 | +env: | ||
| 34 | + RELEASE: | ||
| 35 | + |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 36 | + ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 23 | 37 | ||
| 24 | concurrency: | 38 | concurrency: |
| 25 | group: arm-linux-gnueabihf-${{ github.ref }} | 39 | group: arm-linux-gnueabihf-${{ github.ref }} |
| 26 | cancel-in-progress: true | 40 | cancel-in-progress: true |
| 27 | 41 | ||
| 28 | -permissions: | ||
| 29 | - contents: read | ||
| 30 | - | ||
| 31 | jobs: | 42 | jobs: |
| 32 | arm_linux_gnueabihf: | 43 | arm_linux_gnueabihf: |
| 33 | runs-on: ${{ matrix.os }} | 44 | runs-on: ${{ matrix.os }} |
| @@ -124,3 +135,28 @@ jobs: | @@ -124,3 +135,28 @@ jobs: | ||
| 124 | ls -lh ./build-arm-linux-gnueabihf/bin | 135 | ls -lh ./build-arm-linux-gnueabihf/bin |
| 125 | 136 | ||
| 126 | qemu-arm ./build-arm-linux-gnueabihf/bin/sherpa-onnx --help | 137 | qemu-arm ./build-arm-linux-gnueabihf/bin/sherpa-onnx --help |
| 138 | + | ||
| 139 | + - name: Copy files | ||
| 140 | + if: env.RELEASE == 'true' | ||
| 141 | + shell: bash | ||
| 142 | + run: | | ||
| 143 | + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 144 | + | ||
| 145 | + dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-arm-gnueabihf | ||
| 146 | + mkdir $dst | ||
| 147 | + | ||
| 148 | + cp -a build-arm-linux-gnueabihf/install/bin $dst/ | ||
| 149 | + cp -a build-arm-linux-gnueabihf/install/lib $dst/ | ||
| 150 | + cp -a build-arm-linux-gnueabihf/install/include $dst/ | ||
| 151 | + | ||
| 152 | + tree $dst | ||
| 153 | + | ||
| 154 | + tar cjvf ${dst}.tar.bz2 $dst | ||
| 155 | + | ||
| 156 | + - name: Release pre-compiled binaries and libs for arm linux gnueabihf | ||
| 157 | + if: env.RELEASE == 'true' | ||
| 158 | + uses: svenstaro/upload-release-action@v2 | ||
| 159 | + with: | ||
| 160 | + file_glob: true | ||
| 161 | + overwrite: true | ||
| 162 | + file: sherpa-onnx-*linux-arm-gnueabihf.tar.bz2 |
| @@ -9,8 +9,20 @@ on: | @@ -9,8 +9,20 @@ on: | ||
| 9 | - './build-ios.sh' | 9 | - './build-ios.sh' |
| 10 | tags: | 10 | tags: |
| 11 | - '*' | 11 | - '*' |
| 12 | + release: | ||
| 13 | + types: | ||
| 14 | + - published | ||
| 12 | 15 | ||
| 13 | workflow_dispatch: | 16 | workflow_dispatch: |
| 17 | + inputs: | ||
| 18 | + release: | ||
| 19 | + description: "Whether to release" | ||
| 20 | + type: boolean | ||
| 21 | + | ||
| 22 | +env: | ||
| 23 | + RELEASE: | ||
| 24 | + |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 25 | + ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 14 | 26 | ||
| 15 | concurrency: | 27 | concurrency: |
| 16 | group: build-xcframework-${{ github.ref }} | 28 | group: build-xcframework-${{ github.ref }} |
| @@ -51,7 +63,7 @@ jobs: | @@ -51,7 +63,7 @@ jobs: | ||
| 51 | 63 | ||
| 52 | tree build-ios | 64 | tree build-ios |
| 53 | 65 | ||
| 54 | - filename=sherpa-onnx-${SHERPA_ONNX_VERSION}-pre-compiled-ios-libs.tar.bz2 | 66 | + filename=sherpa-onnx-${SHERPA_ONNX_VERSION}-ios.tar.bz2 |
| 55 | 67 | ||
| 56 | tar cjvf $filename ./build-ios | 68 | tar cjvf $filename ./build-ios |
| 57 | 69 | ||
| @@ -59,12 +71,12 @@ jobs: | @@ -59,12 +71,12 @@ jobs: | ||
| 59 | 71 | ||
| 60 | - uses: actions/upload-artifact@v2 | 72 | - uses: actions/upload-artifact@v2 |
| 61 | with: | 73 | with: |
| 62 | - name: sherpa-onnx-pre-compiled-ios-libs | 74 | + name: sherpa-onnx-ios-libs |
| 63 | path: ./build-ios | 75 | path: ./build-ios |
| 64 | 76 | ||
| 65 | # https://huggingface.co/docs/hub/spaces-github-actions | 77 | # https://huggingface.co/docs/hub/spaces-github-actions |
| 66 | - name: Publish to huggingface | 78 | - name: Publish to huggingface |
| 67 | - if: ${{ github.repository_owner == 'csukuangfj' }} || ${{ github.repository_owner == 'k2-fsa' }} | 79 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' |
| 68 | env: | 80 | env: |
| 69 | HF_TOKEN: ${{ secrets.HF_TOKEN }} | 81 | HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| 70 | run: | | 82 | run: | |
| @@ -76,13 +88,21 @@ jobs: | @@ -76,13 +88,21 @@ jobs: | ||
| 76 | cd huggingface | 88 | cd huggingface |
| 77 | git lfs pull | 89 | git lfs pull |
| 78 | 90 | ||
| 79 | - cp -v ../sherpa-onnx-*-pre-compiled-ios-libs.tar.bz2 ./ | 91 | + cp -v ../sherpa-onnx-*-ios.tar.bz2 ./ |
| 80 | 92 | ||
| 81 | git status | 93 | git status |
| 82 | git lfs track "*.bz2" | 94 | git lfs track "*.bz2" |
| 83 | 95 | ||
| 84 | git add . | 96 | git add . |
| 85 | 97 | ||
| 86 | - git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-pre-compiled-ios-libs.tar.bz2" | 98 | + git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-ios.tar.bz2" |
| 87 | 99 | ||
| 88 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main | 100 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main |
| 101 | + | ||
| 102 | + - name: Release xcframework | ||
| 103 | + if: env.RELEASE == 'true' | ||
| 104 | + uses: svenstaro/upload-release-action@v2 | ||
| 105 | + with: | ||
| 106 | + file_glob: true | ||
| 107 | + overwrite: true | ||
| 108 | + file: sherpa-onnx-*-ios.tar.bz2 |
| @@ -6,6 +6,20 @@ on: | @@ -6,6 +6,20 @@ on: | ||
| 6 | - dot-net | 6 | - dot-net |
| 7 | tags: | 7 | tags: |
| 8 | - '*' | 8 | - '*' |
| 9 | + release: | ||
| 10 | + types: | ||
| 11 | + - published | ||
| 12 | + | ||
| 13 | + workflow_dispatch: | ||
| 14 | + inputs: | ||
| 15 | + release: | ||
| 16 | + description: "Whether to release" | ||
| 17 | + type: boolean | ||
| 18 | + | ||
| 19 | +env: | ||
| 20 | + RELEASE: | ||
| 21 | + |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 22 | + ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 9 | 23 | ||
| 10 | concurrency: | 24 | concurrency: |
| 11 | group: dot-net-${{ github.ref }} | 25 | group: dot-net-${{ github.ref }} |
| @@ -133,3 +147,11 @@ jobs: | @@ -133,3 +147,11 @@ jobs: | ||
| 133 | # API_KEY is valid until 2024.05.02 | 147 | # API_KEY is valid until 2024.05.02 |
| 134 | cd scripts/dotnet/packages | 148 | cd scripts/dotnet/packages |
| 135 | dotnet nuget push ./org.k2fsa.sherpa.onnx.*.nupkg --skip-duplicate --api-key $API_KEY --source https://api.nuget.org/v3/index.json | 149 | dotnet nuget push ./org.k2fsa.sherpa.onnx.*.nupkg --skip-duplicate --api-key $API_KEY --source https://api.nuget.org/v3/index.json |
| 150 | + | ||
| 151 | + - name: Release nuget packages | ||
| 152 | + if: env.RELEASE == 'true' | ||
| 153 | + uses: svenstaro/upload-release-action@v2 | ||
| 154 | + with: | ||
| 155 | + file_glob: true | ||
| 156 | + overwrite: true | ||
| 157 | + file: scripts/dotnet/packages/*.nupkg |
| @@ -4,6 +4,8 @@ on: | @@ -4,6 +4,8 @@ on: | ||
| 4 | push: | 4 | push: |
| 5 | branches: | 5 | branches: |
| 6 | - master | 6 | - master |
| 7 | + tags: | ||
| 8 | + - '*' | ||
| 7 | paths: | 9 | paths: |
| 8 | - '.github/workflows/linux.yaml' | 10 | - '.github/workflows/linux.yaml' |
| 9 | - '.github/scripts/test-online-transducer.sh' | 11 | - '.github/scripts/test-online-transducer.sh' |
| @@ -26,14 +28,25 @@ on: | @@ -26,14 +28,25 @@ on: | ||
| 26 | - 'cmake/**' | 28 | - 'cmake/**' |
| 27 | - 'sherpa-onnx/csrc/*' | 29 | - 'sherpa-onnx/csrc/*' |
| 28 | - 'sherpa-onnx/c-api/*' | 30 | - 'sherpa-onnx/c-api/*' |
| 31 | + release: | ||
| 32 | + types: | ||
| 33 | + - published | ||
| 34 | + | ||
| 35 | + workflow_dispatch: | ||
| 36 | + inputs: | ||
| 37 | + release: | ||
| 38 | + description: "Whether to release" | ||
| 39 | + type: boolean | ||
| 40 | + | ||
| 41 | +env: | ||
| 42 | + RELEASE: | ||
| 43 | + |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 44 | + ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 29 | 45 | ||
| 30 | concurrency: | 46 | concurrency: |
| 31 | group: linux-${{ github.ref }} | 47 | group: linux-${{ github.ref }} |
| 32 | cancel-in-progress: true | 48 | cancel-in-progress: true |
| 33 | 49 | ||
| 34 | -permissions: | ||
| 35 | - contents: read | ||
| 36 | - | ||
| 37 | jobs: | 50 | jobs: |
| 38 | linux: | 51 | linux: |
| 39 | runs-on: ${{ matrix.os }} | 52 | runs-on: ${{ matrix.os }} |
| @@ -53,13 +66,14 @@ jobs: | @@ -53,13 +66,14 @@ jobs: | ||
| 53 | run: | | 66 | run: | |
| 54 | mkdir build | 67 | mkdir build |
| 55 | cd build | 68 | cd build |
| 56 | - cmake -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} .. | 69 | + cmake -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=./install .. |
| 57 | 70 | ||
| 58 | - name: Build sherpa-onnx for ubuntu | 71 | - name: Build sherpa-onnx for ubuntu |
| 59 | shell: bash | 72 | shell: bash |
| 60 | run: | | 73 | run: | |
| 61 | cd build | 74 | cd build |
| 62 | make -j2 | 75 | make -j2 |
| 76 | + make install | ||
| 63 | 77 | ||
| 64 | ls -lh lib | 78 | ls -lh lib |
| 65 | ls -lh bin | 79 | ls -lh bin |
| @@ -101,3 +115,28 @@ jobs: | @@ -101,3 +115,28 @@ jobs: | ||
| 101 | export EXE=decode-file-c-api | 115 | export EXE=decode-file-c-api |
| 102 | 116 | ||
| 103 | .github/scripts/test-online-transducer.sh | 117 | .github/scripts/test-online-transducer.sh |
| 118 | + | ||
| 119 | + - name: Copy files | ||
| 120 | + if: env.RELEASE == 'true' | ||
| 121 | + shell: bash | ||
| 122 | + run: | | ||
| 123 | + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 124 | + | ||
| 125 | + dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-x64 | ||
| 126 | + mkdir $dst | ||
| 127 | + | ||
| 128 | + cp -a build/install/bin $dst/ | ||
| 129 | + cp -a build/install/lib $dst/ | ||
| 130 | + cp -a build/install/include $dst/ | ||
| 131 | + | ||
| 132 | + tree $dst | ||
| 133 | + | ||
| 134 | + tar cjvf ${dst}.tar.bz2 $dst | ||
| 135 | + | ||
| 136 | + - name: Release pre-compiled binaries and libs for linux x64 | ||
| 137 | + if: env.RELEASE == 'true' && matrix.build_type == 'Release' | ||
| 138 | + uses: svenstaro/upload-release-action@v2 | ||
| 139 | + with: | ||
| 140 | + file_glob: true | ||
| 141 | + overwrite: true | ||
| 142 | + file: sherpa-onnx-*linux-x64.tar.bz2 |
| @@ -23,14 +23,25 @@ on: | @@ -23,14 +23,25 @@ on: | ||
| 23 | - 'CMakeLists.txt' | 23 | - 'CMakeLists.txt' |
| 24 | - 'cmake/**' | 24 | - 'cmake/**' |
| 25 | - 'sherpa-onnx/csrc/*' | 25 | - 'sherpa-onnx/csrc/*' |
| 26 | + release: | ||
| 27 | + types: | ||
| 28 | + - published | ||
| 29 | + | ||
| 30 | + workflow_dispatch: | ||
| 31 | + inputs: | ||
| 32 | + release: | ||
| 33 | + description: "Whether to release" | ||
| 34 | + type: boolean | ||
| 35 | + | ||
| 36 | +env: | ||
| 37 | + RELEASE: | ||
| 38 | + |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 39 | + ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 26 | 40 | ||
| 27 | concurrency: | 41 | concurrency: |
| 28 | group: macos-${{ github.ref }} | 42 | group: macos-${{ github.ref }} |
| 29 | cancel-in-progress: true | 43 | cancel-in-progress: true |
| 30 | 44 | ||
| 31 | -permissions: | ||
| 32 | - contents: read | ||
| 33 | - | ||
| 34 | jobs: | 45 | jobs: |
| 35 | macos: | 46 | macos: |
| 36 | runs-on: ${{ matrix.os }} | 47 | runs-on: ${{ matrix.os }} |
| @@ -50,17 +61,19 @@ jobs: | @@ -50,17 +61,19 @@ jobs: | ||
| 50 | run: | | 61 | run: | |
| 51 | mkdir build | 62 | mkdir build |
| 52 | cd build | 63 | cd build |
| 53 | - cmake -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} .. | 64 | + cmake -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_INSTALL_PREFIX=./install .. |
| 54 | 65 | ||
| 55 | - name: Build sherpa-onnx for macos | 66 | - name: Build sherpa-onnx for macos |
| 56 | shell: bash | 67 | shell: bash |
| 57 | run: | | 68 | run: | |
| 58 | cd build | 69 | cd build |
| 59 | make -j2 | 70 | make -j2 |
| 71 | + make install | ||
| 60 | 72 | ||
| 61 | ls -lh lib | 73 | ls -lh lib |
| 62 | ls -lh bin | 74 | ls -lh bin |
| 63 | 75 | ||
| 76 | + file ./bin/sherpa-onnx | ||
| 64 | 77 | ||
| 65 | - name: Display dependencies of sherpa-onnx for macos | 78 | - name: Display dependencies of sherpa-onnx for macos |
| 66 | shell: bash | 79 | shell: bash |
| @@ -100,3 +113,28 @@ jobs: | @@ -100,3 +113,28 @@ jobs: | ||
| 100 | export EXE=decode-file-c-api | 113 | export EXE=decode-file-c-api |
| 101 | 114 | ||
| 102 | .github/scripts/test-online-transducer.sh | 115 | .github/scripts/test-online-transducer.sh |
| 116 | + | ||
| 117 | + - name: Copy files | ||
| 118 | + if: env.RELEASE == 'true' | ||
| 119 | + shell: bash | ||
| 120 | + run: | | ||
| 121 | + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 122 | + | ||
| 123 | + dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-osx-universal2 | ||
| 124 | + mkdir $dst | ||
| 125 | + | ||
| 126 | + cp -a build/install/bin $dst/ | ||
| 127 | + cp -a build/install/lib $dst/ | ||
| 128 | + cp -a build/install/include $dst/ | ||
| 129 | + | ||
| 130 | + tree $dst | ||
| 131 | + | ||
| 132 | + tar cjvf ${dst}.tar.bz2 $dst | ||
| 133 | + | ||
| 134 | + - name: Release pre-compiled binaries and libs for macOS | ||
| 135 | + if: env.RELEASE == 'true' && matrix.build_type == 'Release' | ||
| 136 | + uses: svenstaro/upload-release-action@v2 | ||
| 137 | + with: | ||
| 138 | + file_glob: true | ||
| 139 | + overwrite: true | ||
| 140 | + file: sherpa-onnx-*osx-universal2.tar.bz2 |
| @@ -15,6 +15,8 @@ on: | @@ -15,6 +15,8 @@ on: | ||
| 15 | - '.github/workflows/test-dot-net' | 15 | - '.github/workflows/test-dot-net' |
| 16 | - 'dotnet-examples/**' | 16 | - 'dotnet-examples/**' |
| 17 | 17 | ||
| 18 | + workflow_dispatch: | ||
| 19 | + | ||
| 18 | schedule: | 20 | schedule: |
| 19 | # minute (0-59) | 21 | # minute (0-59) |
| 20 | # hour (0-23) | 22 | # hour (0-23) |
| @@ -4,6 +4,8 @@ on: | @@ -4,6 +4,8 @@ on: | ||
| 4 | push: | 4 | push: |
| 5 | branches: | 5 | branches: |
| 6 | - master | 6 | - master |
| 7 | + tags: | ||
| 8 | + - '*' | ||
| 7 | paths: | 9 | paths: |
| 8 | - '.github/workflows/windows-x64.yaml' | 10 | - '.github/workflows/windows-x64.yaml' |
| 9 | - '.github/scripts/test-online-transducer.sh' | 11 | - '.github/scripts/test-online-transducer.sh' |
| @@ -23,14 +25,25 @@ on: | @@ -23,14 +25,25 @@ on: | ||
| 23 | - 'CMakeLists.txt' | 25 | - 'CMakeLists.txt' |
| 24 | - 'cmake/**' | 26 | - 'cmake/**' |
| 25 | - 'sherpa-onnx/csrc/*' | 27 | - 'sherpa-onnx/csrc/*' |
| 28 | + release: | ||
| 29 | + types: | ||
| 30 | + - published | ||
| 31 | + | ||
| 32 | + workflow_dispatch: | ||
| 33 | + inputs: | ||
| 34 | + release: | ||
| 35 | + description: "Whether to release" | ||
| 36 | + type: boolean | ||
| 37 | + | ||
| 38 | +env: | ||
| 39 | + RELEASE: | ||
| 40 | + |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 41 | + ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 26 | 42 | ||
| 27 | concurrency: | 43 | concurrency: |
| 28 | group: windows-x64-${{ github.ref }} | 44 | group: windows-x64-${{ github.ref }} |
| 29 | cancel-in-progress: true | 45 | cancel-in-progress: true |
| 30 | 46 | ||
| 31 | -permissions: | ||
| 32 | - contents: read | ||
| 33 | - | ||
| 34 | jobs: | 47 | jobs: |
| 35 | windows_x64: | 48 | windows_x64: |
| 36 | runs-on: ${{ matrix.os }} | 49 | runs-on: ${{ matrix.os }} |
| @@ -65,13 +78,14 @@ jobs: | @@ -65,13 +78,14 @@ jobs: | ||
| 65 | run: | | 78 | run: | |
| 66 | mkdir build | 79 | mkdir build |
| 67 | cd build | 80 | cd build |
| 68 | - cmake -T ${{ matrix.toolset-version}},host=x64 -A x64 -D CMAKE_BUILD_TYPE=Release .. | 81 | + cmake -T ${{ matrix.toolset-version}},host=x64 -A x64 -D CMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install .. |
| 69 | 82 | ||
| 70 | - name: Build sherpa-onnx for windows | 83 | - name: Build sherpa-onnx for windows |
| 71 | shell: bash | 84 | shell: bash |
| 72 | run: | | 85 | run: | |
| 73 | cd build | 86 | cd build |
| 74 | cmake --build . --config Release -- -m:2 | 87 | cmake --build . --config Release -- -m:2 |
| 88 | + cmake --build . --config Release --target install -- -m:2 | ||
| 75 | 89 | ||
| 76 | ls -lh ./bin/Release/sherpa-onnx.exe | 90 | ls -lh ./bin/Release/sherpa-onnx.exe |
| 77 | 91 | ||
| @@ -106,3 +120,26 @@ jobs: | @@ -106,3 +120,26 @@ jobs: | ||
| 106 | export EXE=decode-file-c-api.exe | 120 | export EXE=decode-file-c-api.exe |
| 107 | 121 | ||
| 108 | .github/scripts/test-online-transducer.sh | 122 | .github/scripts/test-online-transducer.sh |
| 123 | + | ||
| 124 | + - name: Copy files | ||
| 125 | + if: env.RELEASE == 'true' && matrix.vs-version == 'vs2015' | ||
| 126 | + shell: bash | ||
| 127 | + run: | | ||
| 128 | + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 129 | + | ||
| 130 | + dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x64 | ||
| 131 | + mkdir $dst | ||
| 132 | + | ||
| 133 | + cp -a build/install/bin $dst/ | ||
| 134 | + cp -a build/install/lib $dst/ | ||
| 135 | + cp -a build/install/include $dst/ | ||
| 136 | + | ||
| 137 | + tar cjvf ${dst}.tar.bz2 $dst | ||
| 138 | + | ||
| 139 | + - name: Release pre-compiled binaries and libs for macOS | ||
| 140 | + if: env.RELEASE == 'true' && matrix.vs-version == 'vs2015' | ||
| 141 | + uses: svenstaro/upload-release-action@v2 | ||
| 142 | + with: | ||
| 143 | + file_glob: true | ||
| 144 | + overwrite: true | ||
| 145 | + file: sherpa-onnx-*-win-x64.tar.bz2 |
| @@ -23,17 +23,28 @@ on: | @@ -23,17 +23,28 @@ on: | ||
| 23 | - 'CMakeLists.txt' | 23 | - 'CMakeLists.txt' |
| 24 | - 'cmake/**' | 24 | - 'cmake/**' |
| 25 | - 'sherpa-onnx/csrc/*' | 25 | - 'sherpa-onnx/csrc/*' |
| 26 | + release: | ||
| 27 | + types: | ||
| 28 | + - published | ||
| 29 | + | ||
| 30 | + workflow_dispatch: | ||
| 31 | + inputs: | ||
| 32 | + release: | ||
| 33 | + description: "Whether to release" | ||
| 34 | + type: boolean | ||
| 35 | + | ||
| 36 | +env: | ||
| 37 | + RELEASE: | ||
| 38 | + |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 39 | + ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 26 | 40 | ||
| 27 | concurrency: | 41 | concurrency: |
| 28 | group: windows-x86-${{ github.ref }} | 42 | group: windows-x86-${{ github.ref }} |
| 29 | cancel-in-progress: true | 43 | cancel-in-progress: true |
| 30 | 44 | ||
| 31 | -permissions: | ||
| 32 | - contents: read | ||
| 33 | - | ||
| 34 | jobs: | 45 | jobs: |
| 35 | windows_x86: | 46 | windows_x86: |
| 36 | - if: false # disable windows x86 CI for now | 47 | + if: true # disable windows x86 CI for now |
| 37 | runs-on: ${{ matrix.os }} | 48 | runs-on: ${{ matrix.os }} |
| 38 | name: ${{ matrix.vs-version }} | 49 | name: ${{ matrix.vs-version }} |
| 39 | strategy: | 50 | strategy: |
| @@ -66,13 +77,14 @@ jobs: | @@ -66,13 +77,14 @@ jobs: | ||
| 66 | run: | | 77 | run: | |
| 67 | mkdir build | 78 | mkdir build |
| 68 | cd build | 79 | cd build |
| 69 | - cmake -T ${{ matrix.toolset-version}},host=x64 -A Win32 -D CMAKE_BUILD_TYPE=Release .. | 80 | + cmake -T ${{ matrix.toolset-version}},host=x64 -A Win32 -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=./install .. |
| 70 | 81 | ||
| 71 | - name: Build sherpa-onnx for windows | 82 | - name: Build sherpa-onnx for windows |
| 72 | shell: bash | 83 | shell: bash |
| 73 | run: | | 84 | run: | |
| 74 | cd build | 85 | cd build |
| 75 | cmake --build . --config Release -- -m:2 | 86 | cmake --build . --config Release -- -m:2 |
| 87 | + cmake --build . --config Release --target install -- -m:2 | ||
| 76 | 88 | ||
| 77 | ls -lh ./bin/Release/sherpa-onnx.exe | 89 | ls -lh ./bin/Release/sherpa-onnx.exe |
| 78 | 90 | ||
| @@ -84,13 +96,13 @@ jobs: | @@ -84,13 +96,13 @@ jobs: | ||
| 84 | 96 | ||
| 85 | .github/scripts/test-offline-ctc.sh | 97 | .github/scripts/test-offline-ctc.sh |
| 86 | 98 | ||
| 87 | - - name: Test offline transducer for Windows x86 | ||
| 88 | - shell: bash | ||
| 89 | - run: | | ||
| 90 | - export PATH=$PWD/build/bin/Release:$PATH | ||
| 91 | - export EXE=sherpa-onnx-offline.exe | ||
| 92 | - | ||
| 93 | - .github/scripts/test-offline-transducer.sh | 99 | + # - name: Test offline transducer for Windows x86 |
| 100 | + # shell: bash | ||
| 101 | + # run: | | ||
| 102 | + # export PATH=$PWD/build/bin/Release:$PATH | ||
| 103 | + # export EXE=sherpa-onnx-offline.exe | ||
| 104 | + # | ||
| 105 | + # .github/scripts/test-offline-transducer.sh | ||
| 94 | 106 | ||
| 95 | - name: Test online transducer for Windows x86 | 107 | - name: Test online transducer for Windows x86 |
| 96 | shell: bash | 108 | shell: bash |
| @@ -107,3 +119,26 @@ jobs: | @@ -107,3 +119,26 @@ jobs: | ||
| 107 | export EXE=decode-file-c-api.exe | 119 | export EXE=decode-file-c-api.exe |
| 108 | 120 | ||
| 109 | .github/scripts/test-online-transducer.sh | 121 | .github/scripts/test-online-transducer.sh |
| 122 | + | ||
| 123 | + - name: Copy files | ||
| 124 | + if: env.RELEASE == 'true' && matrix.vs-version == 'vs2015' | ||
| 125 | + shell: bash | ||
| 126 | + run: | | ||
| 127 | + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 128 | + | ||
| 129 | + dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x86 | ||
| 130 | + mkdir $dst | ||
| 131 | + | ||
| 132 | + cp -a build/install/bin $dst/ | ||
| 133 | + cp -a build/install/lib $dst/ | ||
| 134 | + cp -a build/install/include $dst/ | ||
| 135 | + | ||
| 136 | + tar cjvf ${dst}.tar.bz2 $dst | ||
| 137 | + | ||
| 138 | + - name: Release pre-compiled binaries and libs for macOS | ||
| 139 | + if: env.RELEASE == 'true' && matrix.vs-version == 'vs2015' | ||
| 140 | + uses: svenstaro/upload-release-action@v2 | ||
| 141 | + with: | ||
| 142 | + file_glob: true | ||
| 143 | + overwrite: true | ||
| 144 | + file: sherpa-onnx-*-win-x86.tar.bz2 |
| @@ -34,7 +34,7 @@ def get_dict(): | @@ -34,7 +34,7 @@ def get_dict(): | ||
| 34 | def process_linux(s): | 34 | def process_linux(s): |
| 35 | libs = [ | 35 | libs = [ |
| 36 | "libkaldi-native-fbank-core.so", | 36 | "libkaldi-native-fbank-core.so", |
| 37 | - "libonnxruntime.so.1.14.0", | 37 | + "libonnxruntime.so.1.15.1", |
| 38 | "libsherpa-onnx-c-api.so", | 38 | "libsherpa-onnx-c-api.so", |
| 39 | "libsherpa-onnx-core.so", | 39 | "libsherpa-onnx-core.so", |
| 40 | ] | 40 | ] |
| @@ -56,7 +56,7 @@ def process_linux(s): | @@ -56,7 +56,7 @@ def process_linux(s): | ||
| 56 | def process_macos(s): | 56 | def process_macos(s): |
| 57 | libs = [ | 57 | libs = [ |
| 58 | "libkaldi-native-fbank-core.dylib", | 58 | "libkaldi-native-fbank-core.dylib", |
| 59 | - "libonnxruntime.1.14.0.dylib", | 59 | + "libonnxruntime.1.15.1.dylib", |
| 60 | "libsherpa-onnx-c-api.dylib", | 60 | "libsherpa-onnx-c-api.dylib", |
| 61 | "libsherpa-onnx-core.dylib", | 61 | "libsherpa-onnx-core.dylib", |
| 62 | ] | 62 | ] |
-
请 注册 或 登录 后发表评论