-
Notifications
You must be signed in to change notification settings - Fork 0
309 lines (258 loc) · 8.85 KB
/
release.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
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
name: jGL release
on:
push:
branches: [ "main" ]
tags: 'v*'
paths-ignore:
- 'doc/**'
- '.github/**'
workflow_dispatch:
jobs:
linuxNative:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential xorg-dev mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev libxinerama-dev libxcursor-dev xvfb x11-apps vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools
- name: linux-linux
run: |
./build.sh -t -r -e
mkdir linux-x86_64
cp -r build/Examples linux-x86_64-examples
cp build/libjGL.a linux-x86_64/libjGL-linux-x86_64.a
cp LICENSE linux-x86_64-examples/
cp LICENSE linux-x86_64/
- name: pack headers
run: |
ls
mkdir headers
cp -r include/jGL headers/
cp -r include/jLog headers/
cp -r include/jThread headers/
cp -r include/Util headers/
cp -r include/*.h headers/
cp -r include/vendored/freetype/include/* headers/
cp -r include/vendored/glew/include/GL headers/
cp -r include/vendored/glfw/include/GLFW headers/
cp -r include/vendored/glm/glm headers/
cp -r include/vendored/stduuid/include/uuid.h headers/
cp -r include/vendored/stduuid/gsl headers/
cp -r include/vendored/stb_image.h headers/
ls headers
- name: Tests
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ctest --exclude-regex Vulkan --extra-verbose --output-on-failure
- name: build artifact
uses: actions/upload-artifact@v3
with:
name: linux-x86_64
path: linux-x86_64
- name: build examples artifact
uses: actions/upload-artifact@v3
with:
name: linux-x86_64-examples
path: linux-x86_64-examples
- name: build header artifact
uses: actions/upload-artifact@v3
with:
name: headers
path: headers
linuxXwindows:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y xorg-dev build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix libxinerama-dev libxcursor-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools
- name: linux-X-windows
run: |
./build.sh -t -w -r -e
mkdir windows
cp -r build/Examples windows-examples
cp build/libjGL.a windows/libjGL-windows.a
cp LICENSE windows-examples/
cp LICENSE windows/
- name: build artifact
uses: actions/upload-artifact@v3
with:
name: windows
path: windows
- name: build examples artifact
uses: actions/upload-artifact@v3
with:
name: windows-examples
path: windows-examples
macosNative:
runs-on: macos-11
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install dependencies
run: |
wget https://vulkan.lunarg.com/sdk/download/1.2.189.0/mac/vulkansdk-macos-1.2.189.0.dmg
hdiutil attach vulkansdk-macos-1.2.189.0.dmg
mkdir ~/vulkan
cd /Volumes/vulkansdk-macos-1.2.189.0/
sudo ./InstallVulkan.app/Contents/macOS/InstallVulkan --root ~/vulkan --accept-licenses --default-answer --confirm-command install
ls ~/vulkan
cd ~/vulkan/
python install_vulkan.py
- name: macos-macos
run: |
./build.sh -o -e -r
mkdir macos
cp -r build/Examples macos-examples
cp build/libjGL.a macos/libjGL-macos.a
cp LICENSE macos-examples/
cp LICENSE macos/*
- name: build artifact
uses: actions/upload-artifact@v3
with:
name: macos
path: macos
- name: build examples artifact
uses: actions/upload-artifact@v3
with:
name: macos-examples
path: macos-examples
linuxRun:
needs: linuxNative
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y xvfb x11-apps imagemagick
- name: get linux build
uses: actions/download-artifact@v3
with:
name: linux-x86_64-examples
- name: launch and screenshot
run: |
ls
cd Particles
chmod +x Particles
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ./Particles &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot.png
sleep 5 && kill $PID
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: screenshot
path: Particles/screenshot.png
# wineRun:
# needs: linuxXwindows
# runs-on: ubuntu-22.04
# steps:
# - name: Install dependencies
# run: sudo apt-get update && sudo apt-get install -y xvfb x11-apps imagemagick wine32 wine64
# - name: get linux build
# uses: actions/download-artifact@v3
# with:
# name: windows-examples
# - name: launch and screenshot
# run: |
# ls
# cd Particles
# chmod +x Particles.exe
# export DISPLAY=:99
# sudo Xvfb :99 -screen 0 800x600x24 &
# sleep 5
# MESA_GL_VERSION_OVERRIDE=3.3 wine64 Particles.exe &
# export PID=$!
# sleep 10
# xwd -root -silent | convert xwd:- png:screenshot.png
# sleep 5 && kill $PID
# - name: upload artifact
# uses: actions/upload-artifact@v3
# with:
# name: screenshot-wine
# path: Particles/screenshot.png
test-release:
needs: [linuxNative]
runs-on: ubuntu-22.04
steps:
- name: get headers
uses: actions/download-artifact@v3
with:
name: headers
- name: get linux build
uses: actions/download-artifact@v3
with:
name: linux-x86_64
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y xorg-dev build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix libxinerama-dev libxcursor-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools xvfb x11-apps imagemagick
- name: linux-X-windows
run: |
cp -r header/* tests/regression/user/include/
cd tests/regression/user
mkdir build && cd build
cmake .. && make
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ./user &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot.png
sleep 5 && kill $PID
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: screenshot-regression
path: build/screenshot.png
release:
needs: [linuxNative, linuxXwindows, macosNative]
if: github.ref_type == 'tag'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: get headers
uses: actions/download-artifact@v3
with:
name: headers
- name: get linux build
uses: actions/download-artifact@v3
with:
name: linux-x86_64
- name: get windows build
uses: actions/download-artifact@v3
with:
name: windows
- name: get macos build
uses: actions/download-artifact@v3
with:
name: macos
- name: pack
run: |
mkdir jGL
mv linux-x86_64 jGL/
mv windows jGL/
mv macos jGL/
mv headers jGL/
mv LICENSE.md jGL/
zip -r jGL.zip jGL/*
# https://github.com/softprops/action-gh-release
- name: release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: true
name: "release-${{ github.ref_name }}"
tag_name: ${{ github.ref }}
files: jGL.zip