1+ name : Build and Deploy GUI Helpers Jar
2+ on :
3+ push :
4+ branches : [ master ]
5+ pull_request :
6+ branches : [ master ]
7+
8+ jobs :
9+ Build-Linux :
10+ runs-on : ubuntu-20.04
11+ steps :
12+ - name : Checkout
13+ uses : actions/checkout@v3
14+ - name : Install Dependencies
15+ run : |
16+ sudo apt-get -y install bluez libbluetooth-dev libdbus-1-dev
17+ - name : Build using Cmake
18+ id : cmake-build
19+ run : |
20+ mkdir build
21+ cd build
22+ cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release ..
23+ make
24+ - name : Upload Artifacts
25+ uses : actions/upload-artifact@v3
26+ if : steps.cmake-build.outputs.exit_code == 0
27+ with :
28+ name : linux-artifacts
29+ path : java-package/openbci_gui_helpers/src/main/resources/
30+ retention-days : 1
31+
32+ Build-Mac :
33+ runs-on : macos-latest
34+ steps :
35+ - name : Checkout
36+ uses : actions/checkout@v3
37+ - name : Setup Python
38+ uses : actions/setup-python@v4
39+ with :
40+ python-version : ' 3.9'
41+ cache : ' pip'
42+ - name : Install Dependencies
43+ run : |
44+ pip install ninja
45+ - name : Build using Cmake
46+ id : cmake-build
47+ run : |
48+ mkdir build
49+ cd build
50+ cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -G Ninja -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 ..
51+ ninja
52+ - name : Upload Artifacts
53+ uses : actions/upload-artifact@v3
54+ if : steps.cmake-build.outputs.exit_code == 0
55+ with :
56+ name : mac-artifacts
57+ path : java-package/openbci_gui_helpers/src/main/resources/
58+ retention-days : 1
59+
60+ Build-Windows :
61+ runs-on : windows-2019
62+ steps :
63+ - name : Checkout
64+ uses : actions/checkout@v3
65+ - name : Build using Cmake
66+ id : cmake-build
67+ run : |
68+ mkdir build
69+ cd build
70+ cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.19041.0 -DCMAKE_INSTALL_PREFIX=..\installed64\ ..
71+ cmake --build . --config Release
72+ - name : Upload Artifacts
73+ uses : actions/upload-artifact@v3
74+ if : steps.cmake-build.outputs.exit_code == 0
75+ with :
76+ name : windows-artifacts
77+ path : java-package/openbci_gui_helpers/src/main/resources/
78+ retention-days : 1
79+
80+ Package-And-Upload :
81+ runs-on : windows-2019
82+ needs : [Build-Linux, Build-Mac, Build-Windows]
83+ steps :
84+ - name : Checkout
85+ uses : actions/checkout@v3
86+ - name : Download Artifacts
87+ uses : actions/download-artifact@v3
88+ - name : Copy Dynamic Libraries
89+ run : |
90+ mkdir -p java-package/openbci_gui_helpers/src/main/resources/
91+ cp -r linux-artifacts/* java-package/openbci_gui_helpers/src/main/resources/
92+ cp -r mac-artifacts/* java-package/openbci_gui_helpers/src/main/resources/
93+ cp -r windows-artifacts/* java-package/openbci_gui_helpers/src/main/resources/
94+ ls -l java-package/openbci_gui_helpers/src/main/resources/
95+ - name : Build Jar
96+ id : build-jar
97+ run : |
98+ cd java-package/openbci_gui_helpers/
99+ mvn package
100+ - name : Upload Jar
101+ id : upload-jar
102+ uses : actions/upload-artifact@v3
103+ with :
104+ name : jar-artifact
105+ path : java-package\openbci_gui_helpers\target\openbci_gui_helpers.jar
106+ retention-days : 30
107+ # Remove dynamic libraries from artifacts if build and upload were successful
108+ - uses : geekyeggo/delete-artifact@v2
109+ if : steps.build-jar.outputs.exit_code == 0 && steps.upload-jar.outputs.exit_code == 0
110+ with :
111+ name : |
112+ linux-artifacts
113+ windows-artifacts
0 commit comments