Skip to content

Commit

Permalink
Deploy 2390d06 to gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Deploy from CI committed Feb 27, 2025
0 parents commit bf14516
Show file tree
Hide file tree
Showing 118 changed files with 15,703 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy
on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pull-requests: write # To create a PR from that branch
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install doxygen
uses: awalsh128/[email protected]
with:
packages: doxygen

- name: Install pdoc3
run: python3 -m pip install pdoc3

- name: Build C# API reference
working-directory: ${{github.workspace}}/april-docs/src/csharp
run: doxygen Doxyfile

- name: Build Python API reference
working-directory: ${{github.workspace}}/april-docs
run: |
GH_DOCS_CI_DONT_LOAD_APRIL_ASR=1 pdoc3 ../bindings/python/april_asr --skip-errors --html --force -o src
sed -i 's/april_asr\._april/april_asr/g' src/april_asr/*.html
- name: Install mdbook
run: |
mkdir mdbook
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Deploy GitHub Pages
run: |
# This assumes your book is in the root of your repository.
# Just add a `cd` here if you need to change to another directory.
cd april-docs
mdbook build
git worktree add gh-pages
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
# Delete the ref to avoid keeping history.
git update-ref -d refs/heads/gh-pages
rm -rf *
mv ../book/* .
git add .
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force --set-upstream origin gh-pages
188 changes: 188 additions & 0 deletions .github/workflows/main.ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
name: AprilASR CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
name: Build library
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest]

runs-on: ${{ matrix.os }}


steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- if: matrix.os == 'ubuntu-20.04'
name: Install apt packages
uses: awalsh128/[email protected]
with:
packages: build-essential cmake wget tar

- if: matrix.os == 'ubuntu-20.04'
name: Download ONNXRuntime (Linux)
shell: bash
working-directory: ${{github.workspace}}
run: ./download_onnx_linux_x64.sh

- if: matrix.os == 'windows-latest'
name: Download ONNXRuntime (Windows)
shell: bash
working-directory: ${{github.workspace}}
run: ./download_onnx_windows_x64.sh

- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build

- if: matrix.os == 'windows-latest'
name: Configure CMake (Windows)
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DUSE_TINYCTHREAD=ON

- if: matrix.os == 'ubuntu-20.04'
name: Configure CMake (Linux)
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON

- name: Build libaprilasr
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config RELEASE

- name: Ensure wheel and auditwheel are installed
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel auditwheel
- if: matrix.os == 'ubuntu-20.04'
name: Update patchelf on Linux
run: python3 -m pip install --upgrade patchelf

- name: Build Python whl
working-directory: ${{github.workspace}}/bindings/python
shell: bash
run: python3 setup.py bdist_wheel

- if: matrix.os == 'ubuntu-20.04'
name: Fix Linux wheel
working-directory: ${{github.workspace}}/bindings/python
shell: bash
run: mkdir wheelhouse && auditwheel repair dist/april_asr-*-py3-none-linux_x86_64.whl --plat manylinux_2_31_x86_64

- if: matrix.os == 'windows-latest'
name: Upload libaprilasr.dll
uses: actions/upload-artifact@v4
with:
name: libaprilasr.dll
path: ${{github.workspace}}/build/Release/libaprilasr.dll

- if: matrix.os == 'windows-latest'
name: Upload onnxruntime.dll
uses: actions/upload-artifact@v4
with:
name: onnxruntime.dll
path: ${{github.workspace}}/lib/lib/onnxruntime.dll

- if: matrix.os == 'windows-latest'
name: Upload Python wheel (Windows)
uses: actions/upload-artifact@v4
with:
name: windows-python-dist
path: ${{github.workspace}}/bindings/python/dist

- if: matrix.os == 'ubuntu-20.04'
name: Upload libaprilasr.so
uses: actions/upload-artifact@v4
with:
name: libaprilasr.so
path: ${{github.workspace}}/build/libaprilasr.so

- if: matrix.os == 'ubuntu-20.04'
name: Upload libonnxruntime.so
uses: actions/upload-artifact@v4
with:
name: libonnxruntime.so
path: ${{github.workspace}}/lib/lib/libonnxruntime.so

- if: matrix.os == 'ubuntu-20.04'
name: Upload Python wheel (Linux)
uses: actions/upload-artifact@v4
with:
name: ubuntu-python-dist
path: ${{github.workspace}}/bindings/python/wheelhouse
nupkg:
name: Build nupkg
needs: build
runs-on: ubuntu-latest


steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install apt packages
uses: awalsh128/[email protected]
with:
packages: mono-mcs nuget

- name: Ensure nuget is installed
run: apt install -y nuget
working-directory: ${{github.workspace}}

- name: Download Linux aprilasr
uses: actions/download-artifact@v4
with:
name: libaprilasr.so
path: ${{github.workspace}}/bindings/csharp/nuget/build/lib/linux-x64/

- name: Download Linux onnxruntime
uses: actions/download-artifact@v4
with:
name: libonnxruntime.so
path: ${{github.workspace}}/bindings/csharp/nuget/build/lib/linux-x64/

- name: Download Windows aprilasr
uses: actions/download-artifact@v4
with:
name: libaprilasr.dll
path: ${{github.workspace}}/bindings/csharp/nuget/build/lib/win-x64/

- name: Download Windows onnxruntime
uses: actions/download-artifact@v4
with:
name: onnxruntime.dll
path: ${{github.workspace}}/bindings/csharp/nuget/build/lib/win-x64/

- name: Display structure of downloaded files
run: ls -R
working-directory: ${{github.workspace}}/bindings/csharp/nuget/build/lib

- name: Build C# bindings
working-directory: ${{github.workspace}}/bindings/csharp/nuget
run: mcs -out:lib/netstandard2.0/AprilAsr.dll -target:library src/*.cs

- name: Run nuget pack
working-directory: ${{github.workspace}}/bindings/csharp/nuget
run: mkdir out && nuget pack -Verbosity detailed -OutputDirectory out

- name: Upload nupkg
uses: actions/upload-artifact@v4
with:
name: nupkg
path: ${{github.workspace}}/bindings/csharp/nuget/out
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.cache
.vs
/build
/build2
/lib
**/__pycache__
*.so
*.egg-info
*.lib
*.pdb
*.dll
*.exp
*.exe
*.nupkg
bindings/csharp/AprilAsrDemo/bin
bindings/csharp/AprilAsrDemo/obj
bindings/python/build
bindings/python/dist
april-docs/src/csharp/html
april-docs/src/april_asr
/result
/result-dev
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Launch",
"env": {"LD_LIBRARY_PATH": "${workspaceFolder}/lib/lib", "APRIL_LOG_LEVEL": "DEBUG"},
"program": "${workspaceFolder}/build/main",
"args": ["${workspaceFolder}/build/test.wav", "${workspaceFolder}/build/aprilv0_en-us.april"],
"cwd": "${workspaceFolder}"
},
]
}
Loading

0 comments on commit bf14516

Please sign in to comment.