-
Notifications
You must be signed in to change notification settings - Fork 15
184 lines (151 loc) · 5.72 KB
/
main.ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
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@v3
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@v3
with:
submodules: recursive
- name: Install apt packages
uses: awalsh128/[email protected]
with:
packages: mono-mcs nuget
- name: Download Linux aprilasr
uses: actions/download-artifact@master
with:
name: libaprilasr.so
path: ${{github.workspace}}/bindings/csharp/nuget/build/lib/linux-x64/
- name: Download Linux onnxruntime
uses: actions/download-artifact@master
with:
name: libonnxruntime.so
path: ${{github.workspace}}/bindings/csharp/nuget/build/lib/linux-x64/
- name: Download Windows aprilasr
uses: actions/download-artifact@master
with:
name: libaprilasr.dll
path: ${{github.workspace}}/bindings/csharp/nuget/build/lib/win-x64/
- name: Download Windows onnxruntime
uses: actions/download-artifact@master
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