Repository navigation
274 lines (236 loc) · 10.3 KB
/
Copy pathbuild.yml
File metadata and controls
274 lines (236 loc) · 10.3 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
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
name: Build
on:
push:
branches:
- main
- dx-rollback
pull_request:
branches:
- main
jobs:
Build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
#Linux-aarch64
- os: ubuntu-22.04
name: Linux-aarch64
other_linker_flags: '-L/usr/aarch64-linux-gnu/local/lib'
arch: aarch64
output: libRemoteInput.so
release: libremoteinput64.so.aarch64
#Linux-64
- os: ubuntu-latest
name: Linux-64
other_linker_flags: '-m64'
arch: x86_64
output: libRemoteInput.so
release: libremoteinput64.so
#MacOS-64
- os: macos-13 #macos-latest
name: MacOS-64
other_linker_flags: '-m64'
arch: x86_64
output: libRemoteInput.dylib
release: libremoteinput64.dylib
#MacOS-aarch64
- os: macos-latest
name: MacOS-aarch64
other_linker_flags: '-m64'
arch: aarch64
output: libRemoteInput.dylib
release: libremoteinput64.dylib.aarch64
#Windows-32
- os: windows-latest
name: Windows-32
other_linker_flags: '-m32'
arch: i686
output: libRemoteInput.dll
release: libremoteinput32.dll
#Windows-64
- os: windows-latest
name: Windows-64
other_linker_flags: '-m64'
arch: x86_64
output: libRemoteInput.dll
release: libremoteinput64.dll
steps:
- uses: actions/checkout@v4.2.2
with:
submodules: true
- name: Set up Python
if: matrix.config.name != 'Linux-aarch64'
uses: actions/setup-python@v4
with:
python-version: '3.x'
#Linux-aarch64
- name: Update Sources - Linux-aarch64
if: matrix.config.name == 'Linux-aarch64'
run: |
#source_version=$(cat /etc/apt/sources.list | grep "main restricted" | head -1 | sed -e 's/.*com\/ //' -e 's/ main.*//')
#echo "Found: ${ source_version }"
sudo sed -Ei 's/^deb /deb \[arch=amd64\,i386\] /' /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy main restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates main restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy universe" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates universe" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
sudo dpkg --add-architecture arm64
sudo apt-get update
- name: Dependencies - Linux-aarch64
if: matrix.config.name == 'Linux-aarch64'
run: |
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
sudo apt-get install libprocps-dev:arm64 mesa-common-dev:arm64 libglu1-mesa:arm64 libglu1-mesa-dev:arm64 libgl1-mesa-glx:arm64 libgl1-mesa-dev:arm64 libglfw3-dev:arm64 cmake
sudo apt-get install openjdk-11-jdk
sudo apt-get install libpython3-dev:arm64
- name: CMake Generate Build Files - Linux-aarch64
if: matrix.config.name == 'Linux-aarch64'
env:
JAVA_HOME: '/usr/lib/jvm/java-11-openjdk-amd64'
run: |
cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g++ -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles"
- name: Build - Linux-aarch64
if: matrix.config.name == 'Linux-aarch64'
env:
JAVA_HOME: '/usr/lib/jvm/java-11-openjdk-amd64'
run: |
cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
#Linux-64
- name: Dependencies - Linux-64
if: matrix.config.name == 'Linux-64'
run: |
sudo apt-get update
sudo apt-get install libproc2-dev mesa-common-dev libglu1-mesa libglu1-mesa-dev libgl1 libgl1-mesa-dev libpython3-dev clang cmake g++
- name: CMake Generate Build Files - Linux-64
if: matrix.config.name == 'Linux-64'
run: |
cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles"
- name: Build - Linux-64
if: matrix.config.name == 'Linux-64'
run: |
cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
#MacOS-64
- name: CMake Generate Build Files - MacOS-64
if: matrix.config.name == 'MacOS-64'
run: |
cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles"
- name: Build - MacOS-64
if: matrix.config.name == 'MacOS-64'
run: |
cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
#MacOS-aarch64
- name: CMake Generate Build Files - MacOS-aarch64
if: matrix.config.name == 'MacOS-aarch64'
run: |
cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles"
- name: Build - MacOS-aarch64
if: matrix.config.name == 'MacOS-aarch64'
run: |
cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
#Windows-32
- name: Dependencies - Windows-32
if: matrix.config.name == 'Windows-32'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
install: mingw-w64-i686-gcc mingw-w64-i686-clang mingw-w64-i686-python mingw-w64-i686-cmake make
update: false
- name: CMake Generate Build Files - Windows-32
if: matrix.config.name == 'Windows-32'
shell: msys2 {0}
run: |
set MSYSTEM=MINGW32
MINGW_INSTALLS=MINGW32
cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles"
- name: Build - Windows-32
if: matrix.config.name == 'Windows-32'
shell: msys2 {0}
run: |
set MSYSTEM=MINGW32
MINGW_INSTALLS=MINGW32
cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
#Windows-64
- name: Dependencies - Windows-64
if: matrix.config.name == 'Windows-64'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-clang mingw-w64-x86_64-python mingw-w64-x86_64-cmake make
update: false
- name: CMake Generate Build Files - Windows-64
if: matrix.config.name == 'Windows-64'
shell: msys2 {0}
run: |
set MSYSTEM=MINGW64
MINGW_INSTALLS=MINGW64
cmake -S '${{ github.workspace }}' -B '${{ github.workspace }}/cmake-build-release' -DCMAKE_BUILD_TYPE=Release -DOTHER_LINKER_FLAGS:STRING=${{ matrix.config.other_linker_flags }} -G "CodeBlocks - Unix Makefiles"
- name: Build - Windows-64
if: matrix.config.name == 'Windows-64'
shell: msys2 {0}
run: |
set MSYSTEM=MINGW64
MINGW_INSTALLS=MINGW64
cmake --build '${{ github.workspace }}/cmake-build-release' --target all -- -j 4
#Shared
- name: Move Artifacts - ${{ matrix.config.name }}
if: github.event_name == 'push'
run: |
mv '${{ github.workspace }}/cmake-build-release/${{ matrix.config.output }}' '${{ github.workspace }}/cmake-build-release/${{ matrix.config.release }}'
- name: 'Upload Artifacts - ${{ matrix.config.name }}'
if: github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
overwrite: true
name: 'artifact-${{ matrix.config.name }}'
path: '${{ github.workspace }}/cmake-build-release/${{ matrix.config.release }}'
Release:
runs-on: ubuntu-latest
needs: [Build]
if: github.event_name == 'push' && github.repository_owner == 'WaspScripts'
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2
with:
ref: main
- name: Set up Git
run: |
git config --global user.name "Wasp Bot"
git config --global user.email "waspbot@waspcripts.com"
- name: Get current date
id: date
run: |
echo "CURRENT_YEAR=$(date +'%Y')" >> $GITHUB_ENV
echo "CURRENT_MONTH=$(date +'%m')" >> $GITHUB_ENV
echo "CURRENT_DAY=$(date +'%d')" >> $GITHUB_ENV
- name: Get commit hash
id: commit-hash
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
pattern: 'artifact-*'
path: 'artifact'
merge-multiple: true
- name: List downloaded files
run: ls -R artifact
- name: Create version tag
id: tag
run: |
TAG_NAME="$CURRENT_YEAR.$CURRENT_MONTH.$CURRENT_DAY-$COMMIT_HASH"
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
git tag $TAG_NAME
git push origin $TAG_NAME
- name: Create GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "$TAG_NAME" \
--title "Release $TAG_NAME" \
--notes "Automated build from commit $COMMIT_HASH on branch $BRANCH_NAME" \
artifact/*