正在显示
14 个修改的文件
包含
33 行增加
和
145 行删除
| @@ -11,6 +11,8 @@ on: | @@ -11,6 +11,8 @@ on: | ||
| 11 | - 'sherpa-onnx/csrc/*' | 11 | - 'sherpa-onnx/csrc/*' |
| 12 | - 'sherpa-onnx/jni/*' | 12 | - 'sherpa-onnx/jni/*' |
| 13 | - 'build-android*.sh' | 13 | - 'build-android*.sh' |
| 14 | + tags: | ||
| 15 | + - '*' | ||
| 14 | pull_request: | 16 | pull_request: |
| 15 | branches: | 17 | branches: |
| 16 | - master | 18 | - master |
| @@ -22,10 +24,6 @@ on: | @@ -22,10 +24,6 @@ on: | ||
| 22 | - 'sherpa-onnx/jni/*' | 24 | - 'sherpa-onnx/jni/*' |
| 23 | - 'build-android*.sh' | 25 | - 'build-android*.sh' |
| 24 | 26 | ||
| 25 | - release: | ||
| 26 | - types: | ||
| 27 | - - published | ||
| 28 | - | ||
| 29 | workflow_dispatch: | 27 | workflow_dispatch: |
| 30 | inputs: | 28 | inputs: |
| 31 | release: | 29 | release: |
| @@ -112,7 +110,7 @@ jobs: | @@ -112,7 +110,7 @@ jobs: | ||
| 112 | 110 | ||
| 113 | # https://huggingface.co/docs/hub/spaces-github-actions | 111 | # https://huggingface.co/docs/hub/spaces-github-actions |
| 114 | - name: Publish to huggingface | 112 | - name: Publish to huggingface |
| 115 | - if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && env.RELEASE == 'true' | 113 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 116 | env: | 114 | env: |
| 117 | HF_TOKEN: ${{ secrets.HF_TOKEN }} | 115 | HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| 118 | run: | | 116 | run: | |
| @@ -136,7 +134,7 @@ jobs: | @@ -136,7 +134,7 @@ jobs: | ||
| 136 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main | 134 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main |
| 137 | 135 | ||
| 138 | - name: Release android libs | 136 | - name: Release android libs |
| 139 | - if: env.RELEASE == 'true' | 137 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 140 | uses: svenstaro/upload-release-action@v2 | 138 | uses: svenstaro/upload-release-action@v2 |
| 141 | with: | 139 | with: |
| 142 | file_glob: true | 140 | file_glob: true |
| @@ -11,6 +11,8 @@ on: | @@ -11,6 +11,8 @@ on: | ||
| 11 | - 'cmake/**' | 11 | - 'cmake/**' |
| 12 | - 'sherpa-onnx/csrc/*' | 12 | - 'sherpa-onnx/csrc/*' |
| 13 | - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' | 13 | - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' |
| 14 | + tags: | ||
| 15 | + - '*' | ||
| 14 | pull_request: | 16 | pull_request: |
| 15 | branches: | 17 | branches: |
| 16 | - master | 18 | - master |
| @@ -20,20 +22,8 @@ on: | @@ -20,20 +22,8 @@ on: | ||
| 20 | - 'cmake/**' | 22 | - 'cmake/**' |
| 21 | - 'sherpa-onnx/csrc/*' | 23 | - 'sherpa-onnx/csrc/*' |
| 22 | - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' | 24 | - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' |
| 23 | - release: | ||
| 24 | - types: | ||
| 25 | - - published | ||
| 26 | 25 | ||
| 27 | workflow_dispatch: | 26 | 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' }} | ||
| 37 | 27 | ||
| 38 | concurrency: | 28 | concurrency: |
| 39 | group: arm-linux-gnueabihf-${{ github.ref }} | 29 | group: arm-linux-gnueabihf-${{ github.ref }} |
| @@ -131,7 +121,6 @@ jobs: | @@ -131,7 +121,6 @@ jobs: | ||
| 131 | export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH | 121 | export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH |
| 132 | export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/arm-linux-gnueabihf/libc | 122 | export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/arm-linux-gnueabihf/libc |
| 133 | 123 | ||
| 134 | - | ||
| 135 | ls -lh ./build-arm-linux-gnueabihf/bin | 124 | ls -lh ./build-arm-linux-gnueabihf/bin |
| 136 | 125 | ||
| 137 | qemu-arm ./build-arm-linux-gnueabihf/bin/sherpa-onnx --help | 126 | qemu-arm ./build-arm-linux-gnueabihf/bin/sherpa-onnx --help |
| @@ -156,7 +145,7 @@ jobs: | @@ -156,7 +145,7 @@ jobs: | ||
| 156 | path: sherpa-onnx-*linux-arm-gnueabihf.tar.bz2 | 145 | path: sherpa-onnx-*linux-arm-gnueabihf.tar.bz2 |
| 157 | 146 | ||
| 158 | - name: Release pre-compiled binaries and libs for arm linux gnueabihf | 147 | - name: Release pre-compiled binaries and libs for arm linux gnueabihf |
| 159 | - if: env.RELEASE == 'true' | 148 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 160 | uses: svenstaro/upload-release-action@v2 | 149 | uses: svenstaro/upload-release-action@v2 |
| 161 | with: | 150 | with: |
| 162 | file_glob: true | 151 | file_glob: true |
| @@ -14,15 +14,6 @@ on: | @@ -14,15 +14,6 @@ on: | ||
| 14 | - published | 14 | - published |
| 15 | 15 | ||
| 16 | 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' }} | ||
| 26 | 17 | ||
| 27 | concurrency: | 18 | concurrency: |
| 28 | group: build-xcframework-${{ github.ref }} | 19 | group: build-xcframework-${{ github.ref }} |
| @@ -76,7 +67,7 @@ jobs: | @@ -76,7 +67,7 @@ jobs: | ||
| 76 | 67 | ||
| 77 | # https://huggingface.co/docs/hub/spaces-github-actions | 68 | # https://huggingface.co/docs/hub/spaces-github-actions |
| 78 | - name: Publish to huggingface | 69 | - name: Publish to huggingface |
| 79 | - if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' | 70 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 80 | env: | 71 | env: |
| 81 | HF_TOKEN: ${{ secrets.HF_TOKEN }} | 72 | HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| 82 | run: | | 73 | run: | |
| @@ -100,7 +91,7 @@ jobs: | @@ -100,7 +91,7 @@ jobs: | ||
| 100 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main | 91 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main |
| 101 | 92 | ||
| 102 | - name: Release xcframework | 93 | - name: Release xcframework |
| 103 | - if: env.RELEASE == 'true' | 94 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 104 | uses: svenstaro/upload-release-action@v2 | 95 | uses: svenstaro/upload-release-action@v2 |
| 105 | with: | 96 | with: |
| 106 | file_glob: true | 97 | file_glob: true |
| @@ -6,20 +6,8 @@ on: | @@ -6,20 +6,8 @@ on: | ||
| 6 | - dot-net | 6 | - dot-net |
| 7 | tags: | 7 | tags: |
| 8 | - '*' | 8 | - '*' |
| 9 | - release: | ||
| 10 | - types: | ||
| 11 | - - published | ||
| 12 | 9 | ||
| 13 | workflow_dispatch: | 10 | 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' }} | ||
| 23 | 11 | ||
| 24 | concurrency: | 12 | concurrency: |
| 25 | group: dot-net-${{ github.ref }} | 13 | group: dot-net-${{ github.ref }} |
| @@ -138,7 +126,7 @@ jobs: | @@ -138,7 +126,7 @@ jobs: | ||
| 138 | path: scripts/dotnet/packages/*.nupkg | 126 | path: scripts/dotnet/packages/*.nupkg |
| 139 | 127 | ||
| 140 | - name: publish .Net packages to nuget.org | 128 | - name: publish .Net packages to nuget.org |
| 141 | - if: github.repository == 'csukuangfj/sherpa-onnx' || github.repository == 'k2-fsa/sherpa-onnx' | 129 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 142 | shell: bash | 130 | shell: bash |
| 143 | env: | 131 | env: |
| 144 | API_KEY: ${{ secrets.NUGET_API_KEY }} | 132 | API_KEY: ${{ secrets.NUGET_API_KEY }} |
| @@ -148,7 +136,7 @@ jobs: | @@ -148,7 +136,7 @@ jobs: | ||
| 148 | dotnet nuget push ./org.k2fsa.sherpa.onnx.*.nupkg --skip-duplicate --api-key $API_KEY --source https://api.nuget.org/v3/index.json | 136 | dotnet nuget push ./org.k2fsa.sherpa.onnx.*.nupkg --skip-duplicate --api-key $API_KEY --source https://api.nuget.org/v3/index.json |
| 149 | 137 | ||
| 150 | - name: Release nuget packages | 138 | - name: Release nuget packages |
| 151 | - if: env.RELEASE == 'true' | 139 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 152 | uses: svenstaro/upload-release-action@v2 | 140 | uses: svenstaro/upload-release-action@v2 |
| 153 | with: | 141 | with: |
| 154 | file_glob: true | 142 | file_glob: true |
| @@ -22,6 +22,8 @@ on: | @@ -22,6 +22,8 @@ on: | ||
| 22 | - 'sherpa-onnx/csrc/*' | 22 | - 'sherpa-onnx/csrc/*' |
| 23 | - 'sherpa-onnx/jni/*' | 23 | - 'sherpa-onnx/jni/*' |
| 24 | 24 | ||
| 25 | + workflow_dispatch: | ||
| 26 | + | ||
| 25 | concurrency: | 27 | concurrency: |
| 26 | group: jni-${{ github.ref }} | 28 | group: jni-${{ github.ref }} |
| 27 | cancel-in-progress: true | 29 | cancel-in-progress: true |
| @@ -30,20 +30,8 @@ on: | @@ -30,20 +30,8 @@ on: | ||
| 30 | - 'cmake/**' | 30 | - 'cmake/**' |
| 31 | - 'sherpa-onnx/csrc/*' | 31 | - 'sherpa-onnx/csrc/*' |
| 32 | - 'sherpa-onnx/c-api/*' | 32 | - 'sherpa-onnx/c-api/*' |
| 33 | - release: | ||
| 34 | - types: | ||
| 35 | - - published | ||
| 36 | 33 | ||
| 37 | workflow_dispatch: | 34 | workflow_dispatch: |
| 38 | - inputs: | ||
| 39 | - release: | ||
| 40 | - description: "Whether to release" | ||
| 41 | - type: boolean | ||
| 42 | - | ||
| 43 | -env: | ||
| 44 | - RELEASE: | ||
| 45 | - |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 46 | - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 47 | 35 | ||
| 48 | concurrency: | 36 | concurrency: |
| 49 | group: linux-gpu-${{ github.ref }} | 37 | group: linux-gpu-${{ github.ref }} |
| @@ -136,7 +124,7 @@ jobs: | @@ -136,7 +124,7 @@ jobs: | ||
| 136 | .github/scripts/test-online-transducer.sh | 124 | .github/scripts/test-online-transducer.sh |
| 137 | 125 | ||
| 138 | - name: Copy files | 126 | - name: Copy files |
| 139 | - if: env.RELEASE == 'true' | 127 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 140 | shell: bash | 128 | shell: bash |
| 141 | run: | | 129 | run: | |
| 142 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | 130 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) |
| @@ -153,7 +141,7 @@ jobs: | @@ -153,7 +141,7 @@ jobs: | ||
| 153 | tar cjvf ${dst}.tar.bz2 $dst | 141 | tar cjvf ${dst}.tar.bz2 $dst |
| 154 | 142 | ||
| 155 | - name: Release pre-compiled binaries and libs for linux x64 | 143 | - name: Release pre-compiled binaries and libs for linux x64 |
| 156 | - if: env.RELEASE == 'true' && matrix.build_type == 'Release' | 144 | + if: 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 | 145 | uses: svenstaro/upload-release-action@v2 |
| 158 | with: | 146 | with: |
| 159 | file_glob: true | 147 | file_glob: true |
| @@ -30,20 +30,8 @@ on: | @@ -30,20 +30,8 @@ on: | ||
| 30 | - 'cmake/**' | 30 | - 'cmake/**' |
| 31 | - 'sherpa-onnx/csrc/*' | 31 | - 'sherpa-onnx/csrc/*' |
| 32 | - 'sherpa-onnx/c-api/*' | 32 | - 'sherpa-onnx/c-api/*' |
| 33 | - release: | ||
| 34 | - types: | ||
| 35 | - - published | ||
| 36 | 33 | ||
| 37 | workflow_dispatch: | 34 | workflow_dispatch: |
| 38 | - inputs: | ||
| 39 | - release: | ||
| 40 | - description: "Whether to release" | ||
| 41 | - type: boolean | ||
| 42 | - | ||
| 43 | -env: | ||
| 44 | - RELEASE: | ||
| 45 | - |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 46 | - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 47 | 35 | ||
| 48 | concurrency: | 36 | concurrency: |
| 49 | group: linux-${{ github.ref }} | 37 | group: linux-${{ github.ref }} |
| @@ -135,7 +123,7 @@ jobs: | @@ -135,7 +123,7 @@ jobs: | ||
| 135 | .github/scripts/test-online-transducer.sh | 123 | .github/scripts/test-online-transducer.sh |
| 136 | 124 | ||
| 137 | - name: Copy files | 125 | - name: Copy files |
| 138 | - if: env.RELEASE == 'true' | 126 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 139 | shell: bash | 127 | shell: bash |
| 140 | run: | | 128 | run: | |
| 141 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | 129 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) |
| @@ -152,7 +140,7 @@ jobs: | @@ -152,7 +140,7 @@ jobs: | ||
| 152 | tar cjvf ${dst}.tar.bz2 $dst | 140 | tar cjvf ${dst}.tar.bz2 $dst |
| 153 | 141 | ||
| 154 | - name: Release pre-compiled binaries and libs for linux x64 | 142 | - name: Release pre-compiled binaries and libs for linux x64 |
| 155 | - if: env.RELEASE == 'true' && matrix.build_type == 'Release' | 143 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 156 | uses: svenstaro/upload-release-action@v2 | 144 | uses: svenstaro/upload-release-action@v2 |
| 157 | with: | 145 | with: |
| 158 | file_glob: true | 146 | file_glob: true |
| @@ -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/macos.yaml' | 10 | - '.github/workflows/macos.yaml' |
| 9 | - '.github/scripts/test-online-transducer.sh' | 11 | - '.github/scripts/test-online-transducer.sh' |
| @@ -25,20 +27,8 @@ on: | @@ -25,20 +27,8 @@ on: | ||
| 25 | - 'CMakeLists.txt' | 27 | - 'CMakeLists.txt' |
| 26 | - 'cmake/**' | 28 | - 'cmake/**' |
| 27 | - 'sherpa-onnx/csrc/*' | 29 | - 'sherpa-onnx/csrc/*' |
| 28 | - release: | ||
| 29 | - types: | ||
| 30 | - - published | ||
| 31 | 30 | ||
| 32 | workflow_dispatch: | 31 | 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' }} | ||
| 42 | 32 | ||
| 43 | concurrency: | 33 | concurrency: |
| 44 | group: macos-${{ github.ref }} | 34 | group: macos-${{ github.ref }} |
| @@ -133,7 +123,7 @@ jobs: | @@ -133,7 +123,7 @@ jobs: | ||
| 133 | .github/scripts/test-online-transducer.sh | 123 | .github/scripts/test-online-transducer.sh |
| 134 | 124 | ||
| 135 | - name: Copy files | 125 | - name: Copy files |
| 136 | - if: env.RELEASE == 'true' | 126 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 137 | shell: bash | 127 | shell: bash |
| 138 | run: | | 128 | run: | |
| 139 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | 129 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) |
| @@ -151,7 +141,7 @@ jobs: | @@ -151,7 +141,7 @@ jobs: | ||
| 151 | tar cjvf ${dst}.tar.bz2 $dst | 141 | tar cjvf ${dst}.tar.bz2 $dst |
| 152 | 142 | ||
| 153 | - name: Release pre-compiled binaries and libs for macOS | 143 | - name: Release pre-compiled binaries and libs for macOS |
| 154 | - if: env.RELEASE == 'true' && matrix.build_type == 'Release' | 144 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 155 | uses: svenstaro/upload-release-action@v2 | 145 | uses: svenstaro/upload-release-action@v2 |
| 156 | with: | 146 | with: |
| 157 | file_glob: true | 147 | file_glob: true |
| @@ -21,20 +21,8 @@ on: | @@ -21,20 +21,8 @@ on: | ||
| 21 | - 'cmake/**' | 21 | - 'cmake/**' |
| 22 | - 'mfc-examples/**' | 22 | - 'mfc-examples/**' |
| 23 | - 'sherpa-onnx/csrc/*' | 23 | - 'sherpa-onnx/csrc/*' |
| 24 | - release: | ||
| 25 | - types: | ||
| 26 | - - published | ||
| 27 | 24 | ||
| 28 | workflow_dispatch: | 25 | workflow_dispatch: |
| 29 | - inputs: | ||
| 30 | - release: | ||
| 31 | - description: "Whether to release" | ||
| 32 | - type: boolean | ||
| 33 | - | ||
| 34 | -env: | ||
| 35 | - RELEASE: | ||
| 36 | - |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 37 | - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 38 | 26 | ||
| 39 | concurrency: | 27 | concurrency: |
| 40 | group: mfc-${{ github.ref }} | 28 | group: mfc-${{ github.ref }} |
| @@ -114,7 +102,7 @@ jobs: | @@ -114,7 +102,7 @@ jobs: | ||
| 114 | path: ./mfc-examples/${{ matrix.arch }}/Release/NonStreamingSpeechRecognition.exe | 102 | path: ./mfc-examples/${{ matrix.arch }}/Release/NonStreamingSpeechRecognition.exe |
| 115 | 103 | ||
| 116 | - name: Release pre-compiled binaries and libs for Windows ${{ matrix.arch }} | 104 | - name: Release pre-compiled binaries and libs for Windows ${{ matrix.arch }} |
| 117 | - if: env.RELEASE == 'true' | 105 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 118 | uses: svenstaro/upload-release-action@v2 | 106 | uses: svenstaro/upload-release-action@v2 |
| 119 | with: | 107 | with: |
| 120 | file_glob: true | 108 | file_glob: true |
| @@ -122,7 +110,7 @@ jobs: | @@ -122,7 +110,7 @@ jobs: | ||
| 122 | file: ./mfc-examples/${{ matrix.arch }}/Release/sherpa-onnx-streaming-*.exe | 110 | file: ./mfc-examples/${{ matrix.arch }}/Release/sherpa-onnx-streaming-*.exe |
| 123 | 111 | ||
| 124 | - name: Release pre-compiled binaries and libs for Windows ${{ matrix.arch }} | 112 | - name: Release pre-compiled binaries and libs for Windows ${{ matrix.arch }} |
| 125 | - if: env.RELEASE == 'true' | 113 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 126 | uses: svenstaro/upload-release-action@v2 | 114 | uses: svenstaro/upload-release-action@v2 |
| 127 | with: | 115 | with: |
| 128 | file_glob: true | 116 | file_glob: true |
| @@ -27,20 +27,8 @@ on: | @@ -27,20 +27,8 @@ on: | ||
| 27 | - 'CMakeLists.txt' | 27 | - 'CMakeLists.txt' |
| 28 | - 'cmake/**' | 28 | - 'cmake/**' |
| 29 | - 'sherpa-onnx/csrc/*' | 29 | - 'sherpa-onnx/csrc/*' |
| 30 | - release: | ||
| 31 | - types: | ||
| 32 | - - published | ||
| 33 | 30 | ||
| 34 | workflow_dispatch: | 31 | workflow_dispatch: |
| 35 | - inputs: | ||
| 36 | - release: | ||
| 37 | - description: "Whether to release" | ||
| 38 | - type: boolean | ||
| 39 | - | ||
| 40 | -env: | ||
| 41 | - RELEASE: | ||
| 42 | - |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 43 | - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 44 | 32 | ||
| 45 | concurrency: | 33 | concurrency: |
| 46 | group: windows-x64-cuda-${{ github.ref }} | 34 | group: windows-x64-cuda-${{ github.ref }} |
| @@ -125,7 +113,7 @@ jobs: | @@ -125,7 +113,7 @@ jobs: | ||
| 125 | .github/scripts/test-online-transducer.sh | 113 | .github/scripts/test-online-transducer.sh |
| 126 | 114 | ||
| 127 | - name: Copy files | 115 | - name: Copy files |
| 128 | - if: env.RELEASE == 'true' | 116 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 129 | shell: bash | 117 | shell: bash |
| 130 | run: | | 118 | run: | |
| 131 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | 119 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) |
| @@ -140,7 +128,7 @@ jobs: | @@ -140,7 +128,7 @@ jobs: | ||
| 140 | tar cjvf ${dst}.tar.bz2 $dst | 128 | tar cjvf ${dst}.tar.bz2 $dst |
| 141 | 129 | ||
| 142 | - name: Release pre-compiled binaries and libs for Windows x64 CUDA | 130 | - name: Release pre-compiled binaries and libs for Windows x64 CUDA |
| 143 | - if: env.RELEASE == 'true' | 131 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 144 | uses: svenstaro/upload-release-action@v2 | 132 | uses: svenstaro/upload-release-action@v2 |
| 145 | with: | 133 | with: |
| 146 | file_glob: true | 134 | file_glob: true |
| @@ -27,20 +27,8 @@ on: | @@ -27,20 +27,8 @@ on: | ||
| 27 | - 'CMakeLists.txt' | 27 | - 'CMakeLists.txt' |
| 28 | - 'cmake/**' | 28 | - 'cmake/**' |
| 29 | - 'sherpa-onnx/csrc/*' | 29 | - 'sherpa-onnx/csrc/*' |
| 30 | - release: | ||
| 31 | - types: | ||
| 32 | - - published | ||
| 33 | 30 | ||
| 34 | workflow_dispatch: | 31 | workflow_dispatch: |
| 35 | - inputs: | ||
| 36 | - release: | ||
| 37 | - description: "Whether to release" | ||
| 38 | - type: boolean | ||
| 39 | - | ||
| 40 | -env: | ||
| 41 | - RELEASE: | ||
| 42 | - |- # Release if there is a release tag name or a release flag in workflow_dispatch | ||
| 43 | - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} | ||
| 44 | 32 | ||
| 45 | concurrency: | 33 | concurrency: |
| 46 | group: windows-x64-${{ github.ref }} | 34 | group: windows-x64-${{ github.ref }} |
| @@ -126,7 +114,7 @@ jobs: | @@ -126,7 +114,7 @@ jobs: | ||
| 126 | .github/scripts/test-online-transducer.sh | 114 | .github/scripts/test-online-transducer.sh |
| 127 | 115 | ||
| 128 | - name: Copy files | 116 | - name: Copy files |
| 129 | - if: env.RELEASE == 'true' | 117 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 130 | shell: bash | 118 | shell: bash |
| 131 | run: | | 119 | run: | |
| 132 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | 120 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) |
| @@ -141,7 +129,7 @@ jobs: | @@ -141,7 +129,7 @@ jobs: | ||
| 141 | tar cjvf ${dst}.tar.bz2 $dst | 129 | tar cjvf ${dst}.tar.bz2 $dst |
| 142 | 130 | ||
| 143 | - name: Release pre-compiled binaries and libs for Windows x64 | 131 | - name: Release pre-compiled binaries and libs for Windows x64 |
| 144 | - if: env.RELEASE == 'true' | 132 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 145 | uses: svenstaro/upload-release-action@v2 | 133 | uses: svenstaro/upload-release-action@v2 |
| 146 | with: | 134 | with: |
| 147 | file_glob: true | 135 | file_glob: true |
| @@ -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-x86.yaml' | 10 | - '.github/workflows/windows-x86.yaml' |
| 9 | - '.github/scripts/test-online-transducer.sh' | 11 | - '.github/scripts/test-online-transducer.sh' |
| @@ -25,20 +27,8 @@ on: | @@ -25,20 +27,8 @@ on: | ||
| 25 | - 'CMakeLists.txt' | 27 | - 'CMakeLists.txt' |
| 26 | - 'cmake/**' | 28 | - 'cmake/**' |
| 27 | - 'sherpa-onnx/csrc/*' | 29 | - 'sherpa-onnx/csrc/*' |
| 28 | - release: | ||
| 29 | - types: | ||
| 30 | - - published | ||
| 31 | 30 | ||
| 32 | workflow_dispatch: | 31 | 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' }} | ||
| 42 | 32 | ||
| 43 | concurrency: | 33 | concurrency: |
| 44 | group: windows-x86-${{ github.ref }} | 34 | group: windows-x86-${{ github.ref }} |
| @@ -124,7 +114,7 @@ jobs: | @@ -124,7 +114,7 @@ jobs: | ||
| 124 | .github/scripts/test-online-transducer.sh | 114 | .github/scripts/test-online-transducer.sh |
| 125 | 115 | ||
| 126 | - name: Copy files | 116 | - name: Copy files |
| 127 | - if: env.RELEASE == 'true' && matrix.vs-version == 'vs2015' | 117 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 128 | shell: bash | 118 | shell: bash |
| 129 | run: | | 119 | run: | |
| 130 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | 120 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) |
| @@ -139,7 +129,7 @@ jobs: | @@ -139,7 +129,7 @@ jobs: | ||
| 139 | tar cjvf ${dst}.tar.bz2 $dst | 129 | tar cjvf ${dst}.tar.bz2 $dst |
| 140 | 130 | ||
| 141 | - name: Release pre-compiled binaries and libs for Windows x86 | 131 | - name: Release pre-compiled binaries and libs for Windows x86 |
| 142 | - if: env.RELEASE == 'true' && matrix.vs-version == 'vs2015' | 132 | + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 143 | uses: svenstaro/upload-release-action@v2 | 133 | uses: svenstaro/upload-release-action@v2 |
| 144 | with: | 134 | with: |
| 145 | file_glob: true | 135 | file_glob: true |
| @@ -407,7 +407,7 @@ func NewOfflineRecognizer(config *OfflineRecognizerConfig) *OfflineRecognizer { | @@ -407,7 +407,7 @@ func NewOfflineRecognizer(config *OfflineRecognizerConfig) *OfflineRecognizer { | ||
| 407 | c.model_config.whisper.decoder = C.CString(config.ModelConfig.Whisper.Decoder) | 407 | c.model_config.whisper.decoder = C.CString(config.ModelConfig.Whisper.Decoder) |
| 408 | defer C.free(unsafe.Pointer(c.model_config.whisper.decoder)) | 408 | defer C.free(unsafe.Pointer(c.model_config.whisper.decoder)) |
| 409 | 409 | ||
| 410 | - c.model_config.tdnn.decoder = C.CString(config.ModelConfig.Tdnn.Model) | 410 | + c.model_config.tdnn.model = C.CString(config.ModelConfig.Tdnn.Model) |
| 411 | defer C.free(unsafe.Pointer(c.model_config.tdnn.model)) | 411 | defer C.free(unsafe.Pointer(c.model_config.tdnn.model)) |
| 412 | 412 | ||
| 413 | c.model_config.tokens = C.CString(config.ModelConfig.Tokens) | 413 | c.model_config.tokens = C.CString(config.ModelConfig.Tokens) |
-
请 注册 或 登录 后发表评论