Refactor github actions tests (#688)
This commit is contained in:
54
.github/workflows/aarch64-linux-gnu-shared.yaml
vendored
54
.github/workflows/aarch64-linux-gnu-shared.yaml
vendored
@@ -12,6 +12,7 @@ on:
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
|
||||
pull_request:
|
||||
branches:
|
||||
@@ -21,6 +22,7 @@ on:
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
|
||||
|
||||
workflow_dispatch:
|
||||
@@ -82,16 +84,16 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: toolchain
|
||||
key: gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz
|
||||
key: gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz
|
||||
|
||||
- name: Download toolchain
|
||||
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
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
|
||||
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
|
||||
|
||||
mkdir $GITHUB_WORKSPACE/toolchain
|
||||
tar xf ./gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz --strip-components 1 -C $GITHUB_WORKSPACE/toolchain
|
||||
tar xf ./gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz --strip-components 1 -C $GITHUB_WORKSPACE/toolchain
|
||||
|
||||
- name: Set environment variable
|
||||
if: steps.cache-build-result.outputs.cache-hit != 'true'
|
||||
@@ -101,19 +103,19 @@ jobs:
|
||||
echo "$GITHUB_WORKSPACE/bin" >> "$GITHUB_PATH"
|
||||
ls -lh "$GITHUB_WORKSPACE/toolchain/bin"
|
||||
|
||||
echo "CC=aarch64-none-linux-gnu-gcc" >> "$GITHUB_ENV"
|
||||
echo "CXX=aarch64-none-linux-gnu-g++" >> "$GITHUB_ENV"
|
||||
echo "CC=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
|
||||
echo "CXX=aarch64-linux-gnu-g++" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Display toolchain info
|
||||
shell: bash
|
||||
run: |
|
||||
aarch64-none-linux-gnu-gcc --version
|
||||
aarch64-linux-gnu-gcc --version
|
||||
|
||||
- name: Display qemu-aarch64 -h
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
|
||||
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-none-linux-gnu/libc
|
||||
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-linux-gnu/libc
|
||||
qemu-aarch64 -h
|
||||
|
||||
- name: build aarch64-linux-gnu
|
||||
@@ -138,7 +140,7 @@ jobs:
|
||||
run: |
|
||||
export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH
|
||||
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
|
||||
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-none-linux-gnu/libc
|
||||
export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/aarch64-linux-gnu/libc
|
||||
|
||||
ls -lh ./build-aarch64-linux-gnu/bin
|
||||
|
||||
@@ -149,7 +151,7 @@ jobs:
|
||||
- name: Copy files
|
||||
shell: bash
|
||||
run: |
|
||||
aarch64-none-linux-gnu-strip --version
|
||||
aarch64-linux-gnu-strip --version
|
||||
|
||||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
|
||||
@@ -164,7 +166,7 @@ jobs:
|
||||
|
||||
ls -lh $dst/bin/
|
||||
echo "strip"
|
||||
aarch64-none-linux-gnu-strip $dst/bin/*
|
||||
aarch64-linux-gnu-strip $dst/bin/*
|
||||
|
||||
tree $dst
|
||||
|
||||
@@ -175,6 +177,38 @@ jobs:
|
||||
name: sherpa-onnx-linux-aarch64-shared
|
||||
path: sherpa-onnx-*linux-aarch64-shared.tar.bz2
|
||||
|
||||
# https://huggingface.co/docs/hub/spaces-github-actions
|
||||
- name: Publish to huggingface
|
||||
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
max_attempts: 20
|
||||
timeout_seconds: 200
|
||||
shell: bash
|
||||
command: |
|
||||
git config --global user.email "csukuangfj@gmail.com"
|
||||
git config --global user.name "Fangjun Kuang"
|
||||
|
||||
rm -rf huggingface
|
||||
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
|
||||
|
||||
cd huggingface
|
||||
git lfs pull
|
||||
mkdir -p aarch64
|
||||
|
||||
cp -v ../sherpa-onnx-*-shared.tar.bz2 ./aarch64
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
|
||||
git add .
|
||||
|
||||
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-aarch64-shared.tar.bz2"
|
||||
|
||||
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
|
||||
|
||||
- name: Release pre-compiled binaries and libs for aarch64 linux
|
||||
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
|
||||
|
||||
34
.github/workflows/aarch64-linux-gnu-static.yaml
vendored
34
.github/workflows/aarch64-linux-gnu-static.yaml
vendored
@@ -12,6 +12,7 @@ on:
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
|
||||
pull_request:
|
||||
branches:
|
||||
@@ -21,6 +22,7 @@ on:
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
|
||||
|
||||
workflow_dispatch:
|
||||
@@ -166,6 +168,38 @@ jobs:
|
||||
name: sherpa-onnx-linux-aarch64-static
|
||||
path: sherpa-onnx-*linux-aarch64-static.tar.bz2
|
||||
|
||||
# https://huggingface.co/docs/hub/spaces-github-actions
|
||||
- name: Publish to huggingface
|
||||
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
max_attempts: 20
|
||||
timeout_seconds: 200
|
||||
shell: bash
|
||||
command: |
|
||||
git config --global user.email "csukuangfj@gmail.com"
|
||||
git config --global user.name "Fangjun Kuang"
|
||||
|
||||
rm -rf huggingface
|
||||
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
|
||||
|
||||
cd huggingface
|
||||
git lfs pull
|
||||
mkdir -p aarch64
|
||||
|
||||
cp -v ../sherpa-onnx-*-static.tar.bz2 ./aarch64
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
|
||||
git add .
|
||||
|
||||
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-aarch64-static.tar.bz2"
|
||||
|
||||
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
|
||||
|
||||
- name: Release pre-compiled binaries and libs for aarch64 linux
|
||||
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
|
||||
|
||||
9
.github/workflows/android.yaml
vendored
9
.github/workflows/android.yaml
vendored
@@ -25,15 +25,6 @@ on:
|
||||
- 'build-android*.sh'
|
||||
|
||||
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: android-${{ github.ref }}
|
||||
|
||||
4
.github/workflows/apk-kws.yaml
vendored
4
.github/workflows/apk-kws.yaml
vendored
@@ -2,8 +2,6 @@ name: apk-kws
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- apk-kws
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
@@ -17,7 +15,7 @@ permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
apk:
|
||||
apk_kws:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
@@ -2,8 +2,6 @@ name: apk-speaker-identification
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- apk
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
@@ -17,7 +15,7 @@ permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
apk_tts:
|
||||
apk_speaker_identification:
|
||||
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: apk for tts ${{ matrix.index }}/${{ matrix.total }}
|
||||
@@ -84,18 +82,7 @@ jobs:
|
||||
ls -lh ./apks/
|
||||
du -h -d1 .
|
||||
|
||||
# - name: Release
|
||||
# uses: svenstaro/upload-release-action@v2
|
||||
# with:
|
||||
# file_glob: true
|
||||
# file: ./apks/*.apk
|
||||
# overwrite: true
|
||||
# repo_name: k2-fsa/sherpa-onnx
|
||||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||
# tag: speaker-recongition-models
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: true
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v3
|
||||
|
||||
2
.github/workflows/apk-tts-engine.yaml
vendored
2
.github/workflows/apk-tts-engine.yaml
vendored
@@ -2,8 +2,6 @@ name: apk-tts-engine
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- apk-tts
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
|
||||
3
.github/workflows/apk-tts.yaml
vendored
3
.github/workflows/apk-tts.yaml
vendored
@@ -2,9 +2,6 @@ name: apk-tts
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- apk-tts
|
||||
- apk
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
|
||||
2
.github/workflows/apk.yaml
vendored
2
.github/workflows/apk.yaml
vendored
@@ -2,8 +2,6 @@ name: apk
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- apk
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
|
||||
34
.github/workflows/arm-linux-gnueabihf.yaml
vendored
34
.github/workflows/arm-linux-gnueabihf.yaml
vendored
@@ -10,6 +10,7 @@ on:
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'toolchains/arm-linux-gnueabihf.toolchain.cmake'
|
||||
tags:
|
||||
- '*'
|
||||
@@ -21,6 +22,7 @@ on:
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'toolchains/arm-linux-gnueabihf.toolchain.cmake'
|
||||
|
||||
workflow_dispatch:
|
||||
@@ -189,6 +191,38 @@ jobs:
|
||||
name: sherpa-onnx-linux-arm-gnueabihf-static
|
||||
path: sherpa-onnx-*linux-arm-gnueabihf-static.tar.bz2
|
||||
|
||||
# https://huggingface.co/docs/hub/spaces-github-actions
|
||||
- name: Publish to huggingface
|
||||
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
max_attempts: 20
|
||||
timeout_seconds: 200
|
||||
shell: bash
|
||||
command: |
|
||||
git config --global user.email "csukuangfj@gmail.com"
|
||||
git config --global user.name "Fangjun Kuang"
|
||||
|
||||
rm -rf huggingface
|
||||
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
|
||||
|
||||
cd huggingface
|
||||
git lfs pull
|
||||
mkdir -p arm32
|
||||
|
||||
cp -v ../sherpa-onnx-*.tar.bz2 ./arm32
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
|
||||
git add .
|
||||
|
||||
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}"
|
||||
|
||||
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
|
||||
|
||||
- name: Release pre-compiled binaries and libs for arm linux gnueabihf ${{ matrix.lib_type }}
|
||||
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
|
||||
|
||||
6
.github/workflows/build-wheels-aarch64.yaml
vendored
6
.github/workflows/build-wheels-aarch64.yaml
vendored
@@ -2,8 +2,6 @@ name: build-wheels-aarch64
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- wheel
|
||||
tags:
|
||||
- '*'
|
||||
workflow_dispatch:
|
||||
@@ -61,10 +59,8 @@ jobs:
|
||||
run: |
|
||||
ls -lh ./wheelhouse/
|
||||
|
||||
ls -lh ./wheelhouse/*.whl
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux_2_28'
|
||||
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux2014'
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v3
|
||||
|
||||
2
.github/workflows/build-wheels-armv7l.yaml
vendored
2
.github/workflows/build-wheels-armv7l.yaml
vendored
@@ -2,8 +2,6 @@ name: build-wheels-armv7l
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- wheel
|
||||
tags:
|
||||
- '*'
|
||||
workflow_dispatch:
|
||||
|
||||
11
.github/workflows/build-wheels-linux.yaml
vendored
11
.github/workflows/build-wheels-linux.yaml
vendored
@@ -2,8 +2,6 @@ name: build-wheels-linux
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- wheel
|
||||
tags:
|
||||
- '*'
|
||||
workflow_dispatch:
|
||||
@@ -12,7 +10,7 @@ env:
|
||||
SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
|
||||
|
||||
concurrency:
|
||||
group: build-wheels-${{ github.ref }}
|
||||
group: build-wheels-linux-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
@@ -84,6 +82,7 @@ jobs:
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v3
|
||||
shell: bash
|
||||
with:
|
||||
max_attempts: 20
|
||||
timeout_seconds: 200
|
||||
@@ -112,6 +111,7 @@ jobs:
|
||||
env:
|
||||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install wheel twine setuptools
|
||||
@@ -119,16 +119,17 @@ jobs:
|
||||
twine upload ./wheelhouse/*.whl
|
||||
|
||||
- name: Build sdist
|
||||
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux_2_28'
|
||||
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux2014'
|
||||
shell: bash
|
||||
run: |
|
||||
python3 setup.py sdist
|
||||
ls -l dist/*
|
||||
|
||||
- name: Publish sdist to PyPI
|
||||
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux_2_28'
|
||||
if: matrix.python-version == 'cp38' && matrix.manylinux == 'manylinux2014'
|
||||
env:
|
||||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
||||
shell: bash
|
||||
run: |
|
||||
twine upload dist/sherpa-onnx-*.tar.gz
|
||||
|
||||
@@ -2,8 +2,6 @@ name: build-wheels-macos-arm64
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- wheel
|
||||
tags:
|
||||
- '*'
|
||||
workflow_dispatch:
|
||||
@@ -16,7 +14,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_wheels:
|
||||
build_wheels_macos_arm64:
|
||||
name: ${{ matrix.python-version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
@@ -34,6 +32,7 @@ jobs:
|
||||
if: matrix.python-version == 'cp37'
|
||||
uses: pypa/cibuildwheel@v2.11.4
|
||||
env:
|
||||
CIBW_BUILD: "${{ matrix.python-version}}-* "
|
||||
CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64'"
|
||||
CIBW_ARCHS: "arm64"
|
||||
CIBW_BUILD_VERBOSITY: 3
|
||||
@@ -58,8 +57,6 @@ jobs:
|
||||
run: |
|
||||
ls -lh ./wheelhouse/
|
||||
|
||||
ls -lh ./wheelhouse/*.whl
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wheel-${{ matrix.python-version }}
|
||||
|
||||
@@ -16,7 +16,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_wheels:
|
||||
build_wheels_macos_x64:
|
||||
name: ${{ matrix.python-version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
@@ -41,6 +41,7 @@ jobs:
|
||||
|
||||
# Don't repair macOS wheels
|
||||
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
|
||||
|
||||
- name: Build wheels
|
||||
if: matrix.python-version != 'cp37'
|
||||
uses: pypa/cibuildwheel@v2.15.0
|
||||
|
||||
2
.github/workflows/build-wheels-win32.yaml
vendored
2
.github/workflows/build-wheels-win32.yaml
vendored
@@ -2,8 +2,6 @@ name: build-wheels-win32
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- wheel
|
||||
tags:
|
||||
- '*'
|
||||
workflow_dispatch:
|
||||
|
||||
2
.github/workflows/build-wheels-win64.yaml
vendored
2
.github/workflows/build-wheels-win64.yaml
vendored
@@ -42,8 +42,6 @@ jobs:
|
||||
run: |
|
||||
ls -lh ./wheelhouse/
|
||||
|
||||
ls -lh ./wheelhouse/*.whl
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wheel-${{ matrix.python-version }}
|
||||
|
||||
16
.github/workflows/build-xcframework.yaml
vendored
16
.github/workflows/build-xcframework.yaml
vendored
@@ -4,11 +4,25 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- xcframework
|
||||
paths:
|
||||
- './build-ios.sh'
|
||||
- '.github/workflows/build-xcframework.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- './build-ios.sh'
|
||||
- '.github/workflows/build-xcframework.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
3
.github/workflows/linux-gpu.yaml
vendored
3
.github/workflows/linux-gpu.yaml
vendored
@@ -50,7 +50,8 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
build_type: [Release, Debug]
|
||||
# build_type: [Release, Debug]
|
||||
build_type: [Release]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
2
.github/workflows/macos.yaml
vendored
2
.github/workflows/macos.yaml
vendored
@@ -18,6 +18,7 @@ on:
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
@@ -33,6 +34,7 @@ on:
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
2
.github/workflows/mfc.yaml
vendored
2
.github/workflows/mfc.yaml
vendored
@@ -12,6 +12,7 @@ on:
|
||||
- 'cmake/**'
|
||||
- 'mfc-examples/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
@@ -21,6 +22,7 @@ on:
|
||||
- 'cmake/**'
|
||||
- 'mfc-examples/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
4
.github/workflows/nightly-wheel-arm.yaml
vendored
4
.github/workflows/nightly-wheel-arm.yaml
vendored
@@ -1,10 +1,6 @@
|
||||
name: nightly-wheel-arm
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- nightly
|
||||
schedule:
|
||||
# minute (0-59)
|
||||
# hour (0-23)
|
||||
|
||||
37
.github/workflows/riscv64-linux.yaml
vendored
37
.github/workflows/riscv64-linux.yaml
vendored
@@ -9,6 +9,7 @@ on:
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'toolchains/riscv64-linux-gnu.toolchain.cmake'
|
||||
- 'build-riscv64-linux-gnu.sh'
|
||||
tags:
|
||||
@@ -22,6 +23,7 @@ on:
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'toolchains/riscv64-linux-gnu.toolchain.cmake'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'build-riscv64-linux-gnu.sh'
|
||||
|
||||
workflow_dispatch:
|
||||
@@ -194,6 +196,8 @@ jobs:
|
||||
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-riscv64-${{ matrix.lib_type }}
|
||||
mkdir $dst
|
||||
|
||||
cp -v $GITHUB_WORKSPACE/toolchain/sysroot/lib/ld-linux-riscv64xthead-lp64d.so.1 build-riscv64-linux-gnu/install/lib/
|
||||
|
||||
ls -lh build-riscv64-linux-gnu/install/lib
|
||||
|
||||
cp -a build-riscv64-linux-gnu/install/bin $dst/
|
||||
@@ -219,6 +223,39 @@ jobs:
|
||||
name: sherpa-onnx-linux-riscv64-shared
|
||||
path: sherpa-onnx-*linux-riscv64-shared.tar.bz2
|
||||
|
||||
# https://huggingface.co/docs/hub/spaces-github-actions
|
||||
- name: Publish to huggingface
|
||||
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
max_attempts: 20
|
||||
timeout_seconds: 200
|
||||
shell: bash
|
||||
command: |
|
||||
git config --global user.email "csukuangfj@gmail.com"
|
||||
git config --global user.name "Fangjun Kuang"
|
||||
|
||||
rm -rf huggingface
|
||||
|
||||
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
|
||||
|
||||
cd huggingface
|
||||
git lfs pull
|
||||
mkdir -p riscv64
|
||||
|
||||
cp -v ../sherpa-onnx-*-shared.tar.bz2 ./riscv64
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
|
||||
git add .
|
||||
|
||||
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-riscv64-shared.tar.bz2"
|
||||
|
||||
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: matrix.lib_type == 'shared'
|
||||
with:
|
||||
|
||||
33
.github/workflows/run-python-test.yaml
vendored
33
.github/workflows/run-python-test.yaml
vendored
@@ -30,19 +30,25 @@ concurrency:
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
SCCACHE_GHA_ENABLED: "true"
|
||||
|
||||
jobs:
|
||||
run-python-test:
|
||||
name: ${{ matrix.os }} ${{ matrix.python-version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest] # windows-latest]
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10"]
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10","3.11", "3.12"]
|
||||
exclude:
|
||||
- os: macos-latest
|
||||
python-version: "3.9"
|
||||
- os: macos-latest
|
||||
python-version: "3.10"
|
||||
# - os: windows-latest
|
||||
# python-version: "3.12"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -50,10 +56,17 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: ccache
|
||||
if: matrix.os != 'windows-latest'
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ matrix.os }}-python-${{ matrix.python-version }}
|
||||
|
||||
- name: Run sccache-cache
|
||||
if: matrix.os == 'windows-latest'
|
||||
uses: mozilla-actions/sccache-action@v0.0.3
|
||||
with:
|
||||
version: "v0.7.4"
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
@@ -62,9 +75,10 @@ jobs:
|
||||
- name: Install Python dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip numpy pypinyin sentencepiece==0.1.96 soundfile
|
||||
python3 -m pip install --upgrade pip numpy pypinyin sentencepiece>=0.1.96 soundfile
|
||||
|
||||
- name: Install sherpa-onnx
|
||||
if: matrix.os != 'windows-latest'
|
||||
shell: bash
|
||||
run: |
|
||||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
@@ -73,11 +87,22 @@ jobs:
|
||||
|
||||
python3 -m pip install --verbose .
|
||||
|
||||
- name: Install sherpa-onnx
|
||||
if: matrix.os == 'windows-latest'
|
||||
shell: bash
|
||||
run: |
|
||||
cmake --version
|
||||
export SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache"
|
||||
echo "SHERPA_ONNX_CMAKE_ARGS: ${SHERPA_ONNX_CMAKE_ARGS}"
|
||||
|
||||
python3 -m pip install --verbose .
|
||||
|
||||
- name: Test sherpa-onnx
|
||||
shell: bash
|
||||
run: |
|
||||
.github/scripts/test-speaker-recognition-python.sh
|
||||
export OS=${{ matrix.os }}
|
||||
.github/scripts/test-python.sh
|
||||
.github/scripts/test-speaker-recognition-python.sh
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
18
.github/workflows/swift.yaml
vendored
18
.github/workflows/swift.yaml
vendored
@@ -4,10 +4,28 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- './build-swift-macos.sh'
|
||||
- '.github/workflows/swift.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'swift-api-examples/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/**'
|
||||
- '.github/scripts/test-swift.sh'
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- './build-swift-macos.sh'
|
||||
- '.github/workflows/swift.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'swift-api-examples/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/**'
|
||||
- '.github/scripts/test-swift.sh'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
22
.github/workflows/test-build-wheel.yaml
vendored
22
.github/workflows/test-build-wheel.yaml
vendored
@@ -4,8 +4,23 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
paths:
|
||||
- 'setup.py'
|
||||
- '.github/workflows/test-build-wheel.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/python/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'setup.py'
|
||||
- '.github/workflows/test-build-wheel.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/python/**'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -15,13 +30,13 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
test-build-wheel:
|
||||
name: ${{ matrix.os }} ${{ matrix.python_version }}
|
||||
name: ${{ matrix.os }} ${{ matrix.python-version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -75,6 +90,7 @@ jobs:
|
||||
export PATH=/c/hostedtoolcache/windows/Python/3.9.13/x64/bin:$PATH
|
||||
export PATH=/c/hostedtoolcache/windows/Python/3.10.11/x64/bin:$PATH
|
||||
export PATH=/c/hostedtoolcache/windows/Python/3.11.8/x64/bin:$PATH
|
||||
export PATH=/c/hostedtoolcache/windows/Python/3.12.2/x64/bin:$PATH
|
||||
|
||||
which sherpa-onnx
|
||||
sherpa-onnx --help
|
||||
|
||||
14
.github/workflows/test-dot-net.yaml
vendored
14
.github/workflows/test-dot-net.yaml
vendored
@@ -4,10 +4,24 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-dot-net.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'dotnet-examples/**'
|
||||
- 'scripts/dotnet/**'
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-dot-net.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'dotnet-examples/**'
|
||||
- 'scripts/dotnet/**'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
14
.github/workflows/test-go.yaml
vendored
14
.github/workflows/test-go.yaml
vendored
@@ -4,9 +4,23 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-go.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'go-api-examples/**'
|
||||
- 'scripts/go/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-go.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'go-api-examples/**'
|
||||
- 'scripts/go/**'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
16
.github/workflows/test-nodejs.yaml
vendored
16
.github/workflows/test-nodejs.yaml
vendored
@@ -4,10 +4,26 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-nodejs.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'scripts/nodejs/**'
|
||||
- 'nodejs-examples/**'
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-nodejs.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'scripts/nodejs/**'
|
||||
- 'nodejs-examples/**'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
3
.github/workflows/test-pip-install.yaml
vendored
3
.github/workflows/test-pip-install.yaml
vendored
@@ -29,7 +29,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
exclude:
|
||||
- os: macos-latest
|
||||
python-version: "3.7"
|
||||
@@ -68,6 +68,7 @@ jobs:
|
||||
export PATH=/c/hostedtoolcache/windows/Python/3.9.13/x64/bin:$PATH
|
||||
export PATH=/c/hostedtoolcache/windows/Python/3.10.11/x64/bin:$PATH
|
||||
export PATH=/c/hostedtoolcache/windows/Python/3.11.8/x64/bin:$PATH
|
||||
export PATH=/c/hostedtoolcache/windows/Python/3.12.2/x64/bin:$PATH
|
||||
|
||||
sherpa-onnx --help
|
||||
sherpa-onnx-keyword-spotter --help
|
||||
|
||||
14
.github/workflows/test-piper-phonemize.yaml
vendored
14
.github/workflows/test-piper-phonemize.yaml
vendored
@@ -3,6 +3,19 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-piper-phonemize.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-piper-phonemize.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -10,7 +23,6 @@ concurrency:
|
||||
group: test-piper-phonemize-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
|
||||
jobs:
|
||||
test_piper_phonemize:
|
||||
name: ${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.shared_lib }}
|
||||
|
||||
@@ -4,9 +4,21 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-python-offline-websocket-server.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/python/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-python-offline-websocket-server.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/python/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
|
||||
@@ -4,9 +4,21 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-python-online-websocket-server.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/python/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/test-python-online-websocket-server.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/python/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
|
||||
46
.github/workflows/windows-x64.yaml
vendored
46
.github/workflows/windows-x64.yaml
vendored
@@ -40,7 +40,7 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
windows_x64:
|
||||
name: Windows x64
|
||||
name: ${{ matrix.shared_lib }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -59,7 +59,6 @@ jobs:
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -A x64 -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} -DCMAKE_INSTALL_PREFIX=./install ..
|
||||
|
||||
- name: Build sherpa-onnx for windows
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -134,12 +133,17 @@ jobs:
|
||||
.github/scripts/test-online-transducer.sh
|
||||
|
||||
- name: Copy files
|
||||
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)
|
||||
|
||||
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x64
|
||||
shared_lib=${{ matrix.shared_lib }}
|
||||
if [[ $shared_lib == "ON" ]]; then
|
||||
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x64-shared
|
||||
else
|
||||
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x64-static
|
||||
fi
|
||||
|
||||
mkdir $dst
|
||||
|
||||
cp -a build/install/bin $dst/
|
||||
@@ -148,10 +152,42 @@ jobs:
|
||||
|
||||
tar cjvf ${dst}.tar.bz2 $dst
|
||||
|
||||
# https://huggingface.co/docs/hub/spaces-github-actions
|
||||
- name: Publish to huggingface
|
||||
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
max_attempts: 20
|
||||
timeout_seconds: 200
|
||||
shell: bash
|
||||
command: |
|
||||
git config --global user.email "csukuangfj@gmail.com"
|
||||
git config --global user.name "Fangjun Kuang"
|
||||
|
||||
rm -rf huggingface
|
||||
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
|
||||
|
||||
cd huggingface
|
||||
git lfs pull
|
||||
mkdir -p win64
|
||||
|
||||
cp -v ../sherpa-onnx-*.tar.bz2 ./win64
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
|
||||
git add .
|
||||
|
||||
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}"
|
||||
|
||||
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
|
||||
|
||||
- name: Release pre-compiled binaries and libs for Windows x64
|
||||
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: sherpa-onnx-*-win-x64.tar.bz2
|
||||
file: sherpa-onnx-*-win-x64*.tar.bz2
|
||||
|
||||
43
.github/workflows/windows-x86.yaml
vendored
43
.github/workflows/windows-x86.yaml
vendored
@@ -134,12 +134,19 @@ jobs:
|
||||
.github/scripts/test-online-transducer.sh
|
||||
|
||||
- name: Copy files
|
||||
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)
|
||||
|
||||
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x86
|
||||
|
||||
shared_lib=${{ matrix.shared_lib }}
|
||||
if [[ $shared_lib == "ON" ]]; then
|
||||
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x86-shared
|
||||
else
|
||||
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-win-x86-static
|
||||
fi
|
||||
|
||||
mkdir $dst
|
||||
|
||||
cp -a build/install/bin $dst/
|
||||
@@ -148,10 +155,42 @@ jobs:
|
||||
|
||||
tar cjvf ${dst}.tar.bz2 $dst
|
||||
|
||||
# https://huggingface.co/docs/hub/spaces-github-actions
|
||||
- name: Publish to huggingface
|
||||
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa'
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
max_attempts: 20
|
||||
timeout_seconds: 200
|
||||
shell: bash
|
||||
command: |
|
||||
git config --global user.email "csukuangfj@gmail.com"
|
||||
git config --global user.name "Fangjun Kuang"
|
||||
|
||||
rm -rf huggingface
|
||||
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
|
||||
|
||||
cd huggingface
|
||||
git lfs pull
|
||||
mkdir -p win32
|
||||
|
||||
cp -v ../sherpa-onnx-*.tar.bz2 ./win32
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
|
||||
git add .
|
||||
|
||||
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}"
|
||||
|
||||
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
|
||||
|
||||
- name: Release pre-compiled binaries and libs for Windows x86
|
||||
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: sherpa-onnx-*-win-x86.tar.bz2
|
||||
file: sherpa-onnx-*-win-x86*.tar.bz2
|
||||
|
||||
Reference in New Issue
Block a user