-
Notifications
You must be signed in to change notification settings - Fork 15
146 lines (119 loc) · 4.46 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
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
- 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/[email protected]
with:
name: libaprilasr.dll
path: ${{github.workspace}}/build/Release/libaprilasr.dll
- if: matrix.os == 'windows-latest'
name: Upload Python wheel (Windows)
uses: actions/[email protected]
with:
name: windows-python-dist
path: ${{github.workspace}}/bindings/python/dist
- if: matrix.os == 'ubuntu-20.04'
name: Upload libaprilasr.so
uses: actions/[email protected]
with:
name: libaprilasr.so
path: ${{github.workspace}}/build/libaprilasr.so
- if: matrix.os == 'ubuntu-20.04'
name: Upload Python wheel (Linux)
uses: actions/[email protected]
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 Windows aprilasr
uses: actions/download-artifact@master
with:
name: libaprilasr.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/[email protected]
with:
name: nupkg
path: ${{github.workspace}}/bindings/csharp/nuget/out