Repository navigation
134 lines (126 loc) · 5.4 KB
/
Copy pathdeploy_cpp_libs.yml
File metadata and controls
134 lines (126 loc) · 5.4 KB
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
name: Deploy Cpp libs
on: [push]
jobs:
CppWindows:
runs-on: windows-2022
strategy:
fail-fast: false
max-parallel: 16
matrix:
msvc_runtime: [static, dynamic]
build_type: [Release, Debug]
arch: [Win32, x64]
steps:
- name: Clone Repository
uses: actions/checkout@v2
- name: Add msbuild to PATH
uses: microsoft/[email protected]
# compile and prepare everything
# need to build SimpleCBLE outside from BrainFlow because they have different Windows System Versions
- name: Compile SimpleCBLE ${{ matrix.build_type }} ${{ matrix.arch }} with MSVC runtime ${{ matrix.msvc_runtime }}
run: |
mkdir %GITHUB_WORKSPACE%\third_party\SimpleBLE\simplecble\%BUILD%_%RUNTIME%_%ARCH%
cd %GITHUB_WORKSPACE%\third_party\SimpleBLE\simplecble\%BUILD%_%RUNTIME%_%ARCH%
cmake -G "Visual Studio 17 2022" -A %ARCH% -DMSVC_RUNTIME=%RUNTIME% -DCMAKE_SYSTEM_VERSION=10.0.19041.0 -DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\artifacts\%ARCH%_%BUILD%_%RUNTIME%\ ..
cmake --build . --target install --config %BUILD% -j 2 --parallel 2
shell: cmd
env:
RUNTIME: ${{ matrix.msvc_runtime }}
BUILD: ${{ matrix.build_type }}
ARCH: ${{ matrix.arch }}
- name: Compile ${{ matrix.build_type }} ${{ matrix.arch }} with MSVC runtime ${{ matrix.msvc_runtime }}
run: |
mkdir %GITHUB_WORKSPACE%\%BUILD%_%RUNTIME%_%ARCH%
cd %GITHUB_WORKSPACE%\%BUILD%_%RUNTIME%_%ARCH%
cmake -DBUILD_BLUETOOTH=ON -DBUILD_ONNX=ON -DBUILD_OYMOTION_SDK=ON -DWARNINGS_AS_ERRORS=OFF -G "Visual Studio 17 2022" -A %ARCH% -DCMAKE_SYSTEM_VERSION=8.1 -DMSVC_RUNTIME=%RUNTIME% -DCMAKE_INSTALL_PREFIX=..\artifacts\%ARCH%_%BUILD%_%RUNTIME%\ ..
cmake --build . --target install --config %BUILD% -j 2 --parallel 2
shell: cmd
env:
RUNTIME: ${{ matrix.msvc_runtime }}
BUILD: ${{ matrix.build_type }}
ARCH: ${{ matrix.arch }}
# Start Deploy Stage
- name: Upload ${{ matrix.build_type }} ${{ matrix.arch }} with MSVC runtime ${{ matrix.msvc_runtime }}
uses: actions/upload-artifact@v4
with:
name: compiled_libs_${{ matrix.arch }}_${{ matrix.build_type }}_${{ matrix.msvc_runtime }}
path: artifacts
CppUnix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 16
matrix:
build_type: [Release, Debug]
os: [ubuntu-latest, macos-15]
steps:
- name: Clone Repository
uses: actions/checkout@v2
- name: Setup CMake
uses: lukka/[email protected]
with:
cmakeVersion: '3.21.4'
- name: Install Ninja
if: runner.os == 'macOS'
run: |
if ! command -v ninja; then
brew install ninja
fi
ninja --version
# build SimpleCBLE outside from brainflow because of different deployment targets
- name: Compile SimpleCBLE MacOS
if: runner.os == 'macOS'
run: |
mkdir $GITHUB_WORKSPACE/third_party/SimpleBLE/simplecble/build
cd $GITHUB_WORKSPACE/third_party/SimpleBLE/simplecble/build
cmake -G Ninja -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/artifacts/macos_$BUILD -DCMAKE_BUILD_TYPE=$BUILD ..
ninja
ninja install
ls -l $GITHUB_WORKSPACE/artifacts/macos_$BUILD/
env:
BUILD: ${{ matrix.build_type }}
- name: Compile BrainFlow for MacOS
if: runner.os == 'macOS'
run: |
mkdir $GITHUB_WORKSPACE/build
cd $GITHUB_WORKSPACE/build
cmake -G Ninja -DBUILD_BLUETOOTH=ON -DWARNINGS_AS_ERRORS=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/artifacts/macos_$BUILD -DCMAKE_BUILD_TYPE=$BUILD ..
ninja
ninja install
ls -l $GITHUB_WORKSPACE/artifacts/macos_$BUILD/
env:
BUILD: ${{ matrix.build_type }}
- name: Compile BrainFlow in ManyLinux
if: (matrix.os == 'ubuntu-latest')
run: |
docker pull dockcross/manylinux_2_28-x64:20240418-88c04a4
docker run -e GITHUB_WORKSPACE -e BUILD -v "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" dockcross/manylinux_2_28-x64:20240418-88c04a4 /bin/bash -e -c '
for attempt in 1 2 3; do
if yum install -y bluez-libs-devel dbus-devel; then
break
fi
if [ "$attempt" -eq 3 ]; then
exit 1
fi
# A mirror can return invalid repomd.xml. Retry with the official HTTPS repo.
sed -i -e "s|^mirrorlist=|# mirrorlist=|" \
-e "s|^# *baseurl=https://repo.almalinux.org/almalinux/|baseurl=https://repo.almalinux.org/almalinux/|" \
/etc/yum.repos.d/almalinux*.repo
yum clean metadata
sleep 5
done
/opt/python/cp36-cp36m/bin/pip3.6 install cmake==3.21.4
cd "$GITHUB_WORKSPACE"
mkdir build_docker
cd build_docker
/opt/_internal/cpython-3.6.15/bin/cmake -DBUILD_BLE=ON -DBUILD_BLUETOOTH=ON -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/artifacts/linux_${BUILD}" -DCMAKE_BUILD_TYPE="$BUILD" ..
make
make install
'
env:
BUILD: ${{ matrix.build_type }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: compiled_libs_${{ matrix.os }}_${{ matrix.build_type }}
path: artifacts