Skip to content

Commit

Permalink
merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
pkufool committed Sep 14, 2023
2 parents 6bf4269 + 087367d commit af8ffd5
Show file tree
Hide file tree
Showing 135 changed files with 4,329 additions and 261 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/jni/*'
- 'build-android*.sh'
tags:
- '*'
pull_request:
branches:
- master
Expand All @@ -22,10 +24,6 @@ on:
- 'sherpa-onnx/jni/*'
- 'build-android*.sh'

release:
types:
- published

workflow_dispatch:
inputs:
release:
Expand Down Expand Up @@ -112,7 +110,7 @@ jobs:

# https://huggingface.co/docs/hub/spaces-github-actions
- name: Publish to huggingface
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && env.RELEASE == 'true'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
Expand All @@ -136,7 +134,7 @@ jobs:
git push https://csukuangfj:[email protected]/csukuangfj/sherpa-onnx-libs main
- name: Release android libs
if: env.RELEASE == 'true'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/apk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
shell: bash
run: |
export ANDROID_NDK=$ANDROID_NDK_LATEST_HOME
./build-apk-two-pass.sh
./build-apk.sh
- name: Display APK
Expand Down
17 changes: 3 additions & 14 deletions .github/workflows/arm-linux-gnueabihf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'toolchains/arm-linux-gnueabihf.toolchain.cmake'
tags:
- '*'
pull_request:
branches:
- master
Expand All @@ -20,20 +22,8 @@ on:
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'toolchains/arm-linux-gnueabihf.toolchain.cmake'
release:
types:
- published

workflow_dispatch:
inputs:
release:
description: "Whether to release"
type: boolean

env:
RELEASE:
|- # Release if there is a release tag name or a release flag in workflow_dispatch
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}

concurrency:
group: arm-linux-gnueabihf-${{ github.ref }}
Expand Down Expand Up @@ -131,7 +121,6 @@ jobs:
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/arm-linux-gnueabihf/libc
ls -lh ./build-arm-linux-gnueabihf/bin
qemu-arm ./build-arm-linux-gnueabihf/bin/sherpa-onnx --help
Expand All @@ -156,7 +145,7 @@ jobs:
path: sherpa-onnx-*linux-arm-gnueabihf.tar.bz2

- name: Release pre-compiled binaries and libs for arm linux gnueabihf
if: env.RELEASE == 'true'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/build-xcframework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ on:
- published

workflow_dispatch:
inputs:
release:
description: "Whether to release"
type: boolean

env:
RELEASE:
|- # Release if there is a release tag name or a release flag in workflow_dispatch
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}

concurrency:
group: build-xcframework-${{ github.ref }}
Expand Down Expand Up @@ -76,7 +67,7 @@ jobs:

# https://huggingface.co/docs/hub/spaces-github-actions
- name: Publish to huggingface
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
Expand All @@ -100,7 +91,7 @@ jobs:
git push https://csukuangfj:[email protected]/csukuangfj/sherpa-onnx-libs main
- name: Release xcframework
if: env.RELEASE == 'true'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/dot-net.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,8 @@ on:
- dot-net
tags:
- '*'
release:
types:
- published

workflow_dispatch:
inputs:
release:
description: "Whether to release"
type: boolean

env:
RELEASE:
|- # Release if there is a release tag name or a release flag in workflow_dispatch
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}

concurrency:
group: dot-net-${{ github.ref }}
Expand Down Expand Up @@ -138,7 +126,7 @@ jobs:
path: scripts/dotnet/packages/*.nupkg

- name: publish .Net packages to nuget.org
if: github.repository == 'csukuangfj/sherpa-onnx' || github.repository == 'k2-fsa/sherpa-onnx'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
shell: bash
env:
API_KEY: ${{ secrets.NUGET_API_KEY }}
Expand All @@ -148,7 +136,7 @@ jobs:
dotnet nuget push ./org.k2fsa.sherpa.onnx.*.nupkg --skip-duplicate --api-key $API_KEY --source https://api.nuget.org/v3/index.json
- name: Release nuget packages
if: env.RELEASE == 'true'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/jni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ on:
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/jni/*'

workflow_dispatch:

concurrency:
group: jni-${{ github.ref }}
cancel-in-progress: true
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/linux-gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,8 @@ on:
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
release:
types:
- published

workflow_dispatch:
inputs:
release:
description: "Whether to release"
type: boolean

env:
RELEASE:
|- # Release if there is a release tag name or a release flag in workflow_dispatch
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}

concurrency:
group: linux-gpu-${{ github.ref }}
Expand Down Expand Up @@ -136,7 +124,7 @@ jobs:
.github/scripts/test-online-transducer.sh
- name: Copy files
if: env.RELEASE == 'true'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
shell: bash
run: |
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
Expand All @@ -153,7 +141,7 @@ jobs:
tar cjvf ${dst}.tar.bz2 $dst
- name: Release pre-compiled binaries and libs for linux x64
if: env.RELEASE == 'true' && matrix.build_type == 'Release'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,8 @@ on:
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
- 'sherpa-onnx/c-api/*'
release:
types:
- published

workflow_dispatch:
inputs:
release:
description: "Whether to release"
type: boolean

env:
RELEASE:
|- # Release if there is a release tag name or a release flag in workflow_dispatch
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}

concurrency:
group: linux-${{ github.ref }}
Expand Down Expand Up @@ -135,7 +123,7 @@ jobs:
.github/scripts/test-online-transducer.sh
- name: Copy files
if: env.RELEASE == 'true'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
shell: bash
run: |
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
Expand All @@ -152,7 +140,7 @@ jobs:
tar cjvf ${dst}.tar.bz2 $dst
- name: Release pre-compiled binaries and libs for linux x64
if: env.RELEASE == 'true' && matrix.build_type == 'Release'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- master
tags:
- '*'
paths:
- '.github/workflows/macos.yaml'
- '.github/scripts/test-online-transducer.sh'
Expand All @@ -25,20 +27,8 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
release:
types:
- published

workflow_dispatch:
inputs:
release:
description: "Whether to release"
type: boolean

env:
RELEASE:
|- # Release if there is a release tag name or a release flag in workflow_dispatch
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}

concurrency:
group: macos-${{ github.ref }}
Expand Down Expand Up @@ -133,7 +123,7 @@ jobs:
.github/scripts/test-online-transducer.sh
- name: Copy files
if: env.RELEASE == 'true'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
shell: bash
run: |
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
Expand All @@ -151,7 +141,7 @@ jobs:
tar cjvf ${dst}.tar.bz2 $dst
- name: Release pre-compiled binaries and libs for macOS
if: env.RELEASE == 'true' && matrix.build_type == 'Release'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/mfc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,8 @@ on:
- 'cmake/**'
- 'mfc-examples/**'
- 'sherpa-onnx/csrc/*'
release:
types:
- published

workflow_dispatch:
inputs:
release:
description: "Whether to release"
type: boolean

env:
RELEASE:
|- # Release if there is a release tag name or a release flag in workflow_dispatch
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}

concurrency:
group: mfc-${{ github.ref }}
Expand Down Expand Up @@ -114,15 +102,15 @@ jobs:
path: ./mfc-examples/${{ matrix.arch }}/Release/NonStreamingSpeechRecognition.exe

- name: Release pre-compiled binaries and libs for Windows ${{ matrix.arch }}
if: env.RELEASE == 'true'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
overwrite: true
file: ./mfc-examples/${{ matrix.arch }}/Release/sherpa-onnx-streaming-*.exe

- name: Release pre-compiled binaries and libs for Windows ${{ matrix.arch }}
if: env.RELEASE == 'true'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/windows-x64-cuda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,8 @@ on:
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
release:
types:
- published

workflow_dispatch:
inputs:
release:
description: "Whether to release"
type: boolean

env:
RELEASE:
|- # Release if there is a release tag name or a release flag in workflow_dispatch
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}

concurrency:
group: windows-x64-cuda-${{ github.ref }}
Expand Down Expand Up @@ -125,7 +113,7 @@ jobs:
.github/scripts/test-online-transducer.sh
- name: Copy files
if: env.RELEASE == 'true'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
shell: bash
run: |
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
Expand All @@ -140,7 +128,7 @@ jobs:
tar cjvf ${dst}.tar.bz2 $dst
- name: Release pre-compiled binaries and libs for Windows x64 CUDA
if: env.RELEASE == 'true'
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
Expand Down
Loading

0 comments on commit af8ffd5

Please sign in to comment.