summaryrefslogtreecommitdiff
path: root/src/contrib/SDL-3.2.20/.github/workflows/release.yml
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
committer3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
commit6aaedb813fa11ba0679c3051bc2eb28646b9506c (patch)
tree34acbfc9840e02cb4753e6306ea7ce978bf8b58e /src/contrib/SDL-3.2.20/.github/workflows/release.yml
parent8f228ade99dd3d4c8da9b78ade1815c9adf85c8f (diff)
Update to SDL3
Diffstat (limited to 'src/contrib/SDL-3.2.20/.github/workflows/release.yml')
-rw-r--r--src/contrib/SDL-3.2.20/.github/workflows/release.yml652
1 files changed, 652 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/.github/workflows/release.yml b/src/contrib/SDL-3.2.20/.github/workflows/release.yml
new file mode 100644
index 0000000..01eaee9
--- /dev/null
+++ b/src/contrib/SDL-3.2.20/.github/workflows/release.yml
@@ -0,0 +1,652 @@
1name: 'release'
2run-name: 'Create SDL release artifacts for ${{ inputs.commit }}'
3
4on:
5 workflow_dispatch:
6 inputs:
7 commit:
8 description: 'Commit of SDL'
9 required: true
10
11jobs:
12
13 src:
14 runs-on: ubuntu-latest
15 outputs:
16 project: ${{ steps.releaser.outputs.project }}
17 version: ${{ steps.releaser.outputs.version }}
18 src-tar-gz: ${{ steps.releaser.outputs.src-tar-gz }}
19 src-tar-xz: ${{ steps.releaser.outputs.src-tar-xz }}
20 src-zip: ${{ steps.releaser.outputs.src-zip }}
21 steps:
22 - name: 'Set up Python'
23 uses: actions/setup-python@v5
24 with:
25 python-version: '3.11'
26 - name: 'Fetch build-release.py'
27 uses: actions/checkout@v4
28 with:
29 sparse-checkout: 'build-scripts/build-release.py'
30 - name: 'Set up SDL sources'
31 uses: actions/checkout@v4
32 with:
33 path: 'SDL'
34 fetch-depth: 0
35 - name: 'Build Source archive'
36 id: releaser
37 shell: bash
38 run: |
39 python build-scripts/build-release.py \
40 --actions source \
41 --commit ${{ inputs.commit }} \
42 --root "${{ github.workspace }}/SDL" \
43 --github \
44 --debug
45 - name: 'Store source archives'
46 uses: actions/upload-artifact@v4
47 with:
48 name: sources
49 path: '${{ github.workspace}}/dist'
50 - name: 'Generate summary'
51 run: |
52 echo "Run the following commands to download all artifacts:" >> $GITHUB_STEP_SUMMARY
53 echo '```' >> $GITHUB_STEP_SUMMARY
54 echo "mkdir -p /tmp/${{ steps.releaser.outputs.project }}-${{ steps.releaser.outputs.version }}" >> $GITHUB_STEP_SUMMARY
55 echo "cd /tmp/${{ steps.releaser.outputs.project }}-${{ steps.releaser.outputs.version }}" >> $GITHUB_STEP_SUMMARY
56 echo "gh run -R ${{ github.repository }} download ${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY
57 echo '```' >> $GITHUB_STEP_SUMMARY
58
59 linux-verify:
60 needs: [src]
61 runs-on: ubuntu-latest
62 steps:
63 - name: 'Download source archives'
64 uses: actions/download-artifact@v4
65 with:
66 name: sources
67 path: '${{ github.workspace }}'
68 - name: 'Unzip ${{ needs.src.outputs.src-zip }}'
69 id: zip
70 run: |
71 mkdir /tmp/zipdir
72 cd /tmp/zipdir
73 unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
74 echo "path=/tmp/zipdir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
75 - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
76 id: tar
77 run: |
78 mkdir -p /tmp/tardir
79 tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
80 echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
81 - name: 'Compare contents of ${{ needs.src.outputs.src-zip }} and ${{ needs.src.outputs.src-tar-gz }}'
82 run: |
83 diff /tmp/zipdir /tmp/tardir
84 - name: 'Test versioning'
85 shell: bash
86 run: |
87 ${{ steps.tar.outputs.path }}/build-scripts/test-versioning.sh
88 - name: 'Install Linux dependencies'
89 run: |
90 sudo apt-get update -y
91 sudo apt-get install -y \
92 gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev \
93 libusb-1.0-0-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev \
94 libxss-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
95 libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
96 - name: 'CMake (configure + build + tests + examples)'
97 run: |
98 cmake -S ${{ steps.tar.outputs.path }} -B /tmp/build -DSDL_TEST_LIBRARY=TRUE -DSDL_TESTS=TRUE -DSDL_EXAMPLES=TRUE
99 cmake --build /tmp/build --verbose
100 ctest --test-dir /tmp/build --no-tests=error --output-on-failure
101
102 dmg:
103 needs: [src]
104 runs-on: macos-latest
105 outputs:
106 dmg: ${{ steps.releaser.outputs.dmg }}
107 steps:
108 - name: 'Set up Python'
109 uses: actions/setup-python@v5
110 with:
111 python-version: '3.11'
112 - name: 'Fetch build-release.py'
113 uses: actions/checkout@v4
114 with:
115 sparse-checkout: 'build-scripts/build-release.py'
116 - name: 'Download source archives'
117 uses: actions/download-artifact@v4
118 with:
119 name: sources
120 path: '${{ github.workspace }}'
121 - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
122 id: tar
123 run: |
124 mkdir -p "${{ github.workspace }}/tardir"
125 tar -C "${{ github.workspace }}/tardir" -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
126 echo "path=${{ github.workspace }}/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
127 - name: 'Build SDL3.dmg'
128 id: releaser
129 shell: bash
130 run: |
131 python build-scripts/build-release.py \
132 --actions dmg \
133 --commit ${{ inputs.commit }} \
134 --root "${{ steps.tar.outputs.path }}" \
135 --github \
136 --debug
137 - name: 'Store DMG image file'
138 uses: actions/upload-artifact@v4
139 with:
140 name: dmg
141 path: '${{ github.workspace }}/dist'
142
143 dmg-verify:
144 needs: [dmg, src]
145 runs-on: macos-latest
146 steps:
147 - name: 'Download source archives'
148 uses: actions/download-artifact@v4
149 with:
150 name: sources
151 path: '${{ github.workspace }}'
152 - name: 'Download ${{ needs.dmg.outputs.dmg }}'
153 uses: actions/download-artifact@v4
154 with:
155 name: dmg
156 path: '${{ github.workspace }}'
157 - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
158 id: src
159 run: |
160 mkdir -p /tmp/tardir
161 tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
162 echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
163 - name: 'Mount ${{ needs.dmg.outputs.dmg }}'
164 id: mount
165 run: |
166 hdiutil attach '${{ github.workspace }}/${{ needs.dmg.outputs.dmg }}'
167 mount_point="/Volumes/${{ needs.src.outputs.project }}"
168 if [ ! -d "$mount_point/${{ needs.src.outputs.project }}.xcframework" ]; then
169 echo "Cannot find ${{ needs.src.outputs.project }}.xcframework!"
170 exit 1
171 fi
172 echo "mount_point=$mount_point">>$GITHUB_OUTPUT
173 - name: 'CMake (configure + build) Darwin'
174 run: |
175 cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
176 -DTEST_FULL=FALSE \
177 -DTEST_STATIC=FALSE \
178 -DTEST_TEST=FALSE \
179 -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
180 -DCMAKE_SYSTEM_NAME=Darwin \
181 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
182 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
183 -Werror=dev \
184 -B build_darwin
185 cmake --build build_darwin --config Release --verbose
186
187 cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
188 -DTEST_FULL=FALSE \
189 -DTEST_STATIC=FALSE \
190 -DTEST_TEST=FALSE \
191 -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}/SDL3.xcframework/macos-arm64_x86_64" \
192 -DCMAKE_SYSTEM_NAME=Darwin \
193 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
194 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
195 -Werror=dev \
196 -B build_darwin_2
197 cmake --build build_darwin --config Release --verbose
198 - name: 'CMake (configure + build) iOS'
199 run: |
200 cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
201 -DTEST_FULL=FALSE \
202 -DTEST_STATIC=FALSE \
203 -DTEST_TEST=FALSE \
204 -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
205 -DCMAKE_SYSTEM_NAME=iOS \
206 -DCMAKE_OSX_ARCHITECTURES="arm64" \
207 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
208 -Werror=dev \
209 -B build_ios
210 cmake --build build_ios --config Release --verbose
211 - name: 'CMake (configure + build) tvOS'
212 run: |
213 cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
214 -DTEST_FULL=FALSE \
215 -DTEST_STATIC=FALSE \
216 -DTEST_TEST=FALSE \
217 -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
218 -DCMAKE_SYSTEM_NAME=tvOS \
219 -DCMAKE_OSX_ARCHITECTURES="arm64" \
220 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
221 -Werror=dev \
222 -B build_tvos
223 cmake --build build_tvos --config Release --verbose
224 - name: 'CMake (configure + build) iOS simulator'
225 run: |
226 sysroot=$(xcodebuild -version -sdk iphonesimulator Path)
227 echo "sysroot=$sysroot"
228 cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
229 -DTEST_FULL=FALSE \
230 -DTEST_STATIC=FALSE \
231 -DTEST_TEST=FALSE \
232 -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
233 -DCMAKE_SYSTEM_NAME=iOS \
234 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
235 -DCMAKE_OSX_SYSROOT="${sysroot}" \
236 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
237 -Werror=dev \
238 -B build_ios_simulator
239 cmake --build build_ios_simulator --config Release --verbose
240 - name: 'CMake (configure + build) tvOS simulator'
241 run: |
242 sysroot=$(xcodebuild -version -sdk appletvsimulator Path)
243 echo "sysroot=$sysroot"
244 cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
245 -DTEST_FULL=FALSE \
246 -DTEST_STATIC=FALSE \
247 -DTEST_TEST=FALSE \
248 -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \
249 -DCMAKE_SYSTEM_NAME=tvOS \
250 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
251 -DCMAKE_OSX_SYSROOT="${sysroot}" \
252 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
253 -Werror=dev \
254 -B build_tvos_simulator
255 cmake --build build_tvos_simulator --config Release --verbose
256
257 msvc:
258 needs: [src]
259 runs-on: windows-2025
260 outputs:
261 VC-x86: ${{ steps.releaser.outputs.VC-x86 }}
262 VC-x64: ${{ steps.releaser.outputs.VC-x64 }}
263 VC-arm64: ${{ steps.releaser.outputs.VC-arm64 }}
264 VC-devel: ${{ steps.releaser.outputs.VC-devel }}
265 steps:
266 - name: 'Set up Python'
267 uses: actions/setup-python@v5
268 with:
269 python-version: '3.11'
270 - name: 'Fetch build-release.py'
271 uses: actions/checkout@v4
272 with:
273 sparse-checkout: 'build-scripts/build-release.py'
274 - name: 'Download source archives'
275 uses: actions/download-artifact@v4
276 with:
277 name: sources
278 path: '${{ github.workspace }}'
279 - name: 'Unzip ${{ needs.src.outputs.src-zip }}'
280 id: zip
281 run: |
282 New-Item C:\temp -ItemType Directory -ErrorAction SilentlyContinue
283 cd C:\temp
284 unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
285 echo "path=C:\temp\${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$Env:GITHUB_OUTPUT
286 - name: 'Build MSVC binary archives'
287 id: releaser
288 run: |
289 python build-scripts/build-release.py `
290 --actions msvc `
291 --commit ${{ inputs.commit }} `
292 --root "${{ steps.zip.outputs.path }}" `
293 --github `
294 --debug
295 - name: 'Store MSVC archives'
296 uses: actions/upload-artifact@v4
297 with:
298 name: win32
299 path: '${{ github.workspace }}/dist'
300
301 msvc-verify:
302 needs: [msvc, src]
303 runs-on: windows-latest
304 steps:
305 - name: 'Fetch .github/actions/setup-ninja/action.yml'
306 uses: actions/checkout@v4
307 with:
308 sparse-checkout: '.github/actions/setup-ninja/action.yml'
309 - name: 'Download source archives'
310 uses: actions/download-artifact@v4
311 with:
312 name: sources
313 path: '${{ github.workspace }}'
314 - name: 'Download MSVC binaries'
315 uses: actions/download-artifact@v4
316 with:
317 name: win32
318 path: '${{ github.workspace }}'
319 - name: 'Unzip ${{ needs.src.outputs.src-zip }}'
320 id: src
321 run: |
322 mkdir '${{ github.workspace }}/sources'
323 cd '${{ github.workspace }}/sources'
324 unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
325 echo "path=${{ github.workspace }}/sources/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT
326 - name: 'Unzip ${{ needs.msvc.outputs.VC-devel }}'
327 id: bin
328 run: |
329 mkdir '${{ github.workspace }}/vc'
330 cd '${{ github.workspace }}/vc'
331 unzip "${{ github.workspace }}/${{ needs.msvc.outputs.VC-devel }}"
332 echo "path=${{ github.workspace }}/vc/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT
333 - name: Set up ninja
334 uses: ./.github/actions/setup-ninja
335 - name: 'Configure vcvars x86'
336 uses: ilammy/msvc-dev-cmd@v1
337 with:
338 arch: x64_x86
339 - name: 'CMake (configure + build + tests) x86'
340 run: |
341 cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
342 -B build_x86 `
343 -GNinja `
344 -DCMAKE_BUILD_TYPE=Debug `
345 -Werror=dev `
346 -DTEST_FULL=TRUE `
347 -DTEST_STATIC=FALSE `
348 -DTEST_SHARED=TRUE `
349 -DTEST_TEST=TRUE `
350 -DCMAKE_SUPPRESS_REGENERATION=TRUE `
351 -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
352 Start-Sleep -Seconds 2
353 cmake --build build_x86 --config Release --verbose
354 ctest --test-dir build_x86 --no-tests=error -C Release --output-on-failure
355 - name: 'Configure vcvars x64'
356 uses: ilammy/msvc-dev-cmd@v1
357 with:
358 arch: x64
359 - name: 'CMake (configure + build + tests) x64'
360 run: |
361 cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
362 -B build_x64 `
363 -GNinja `
364 -DCMAKE_BUILD_TYPE=Debug `
365 -Werror=dev `
366 -DTEST_FULL=TRUE `
367 -DTEST_STATIC=FALSE `
368 -DTEST_SHARED=TRUE `
369 -DTEST_TEST=TRUE `
370 -DCMAKE_SUPPRESS_REGENERATION=TRUE `
371 -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
372 Start-Sleep -Seconds 2
373 cmake --build build_x64 --config Release --verbose
374 ctest --test-dir build_x64 --no-tests=error -C Release --output-on-failure
375 - name: 'Configure vcvars arm64'
376 uses: ilammy/msvc-dev-cmd@v1
377 with:
378 arch: x64_arm64
379 - name: 'CMake (configure + build) arm64'
380 run: |
381 cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
382 -B build_arm64 `
383 -GNinja `
384 -DCMAKE_BUILD_TYPE=Debug `
385 -Werror=dev `
386 -DTEST_FULL=TRUE `
387 -DTEST_STATIC=FALSE `
388 -DTEST_SHARED=TRUE `
389 -DTEST_TEST=TRUE `
390 -DCMAKE_SUPPRESS_REGENERATION=TRUE `
391 -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
392 Start-Sleep -Seconds 2
393 cmake --build build_arm64 --config Release --verbose
394 - name: 'CMake (configure + build) arm64ec'
395 run: |
396 cmake -S "${{ steps.src.outputs.path }}/cmake/test" `
397 -B build_arm64ec `
398 -GNinja `
399 -DCMAKE_BUILD_TYPE=Debug `
400 -Werror=dev `
401 -DTEST_FULL=TRUE `
402 -DTEST_STATIC=FALSE `
403 -DTEST_SHARED=TRUE `
404 -DTEST_TEST=TRUE `
405 -DSDL_DISABLE_AVX=TRUE `
406 -DSDL_DISABLE_AVX2=TRUE `
407 -DSDL_DISABLE_AVX512F=TRUE `
408 -DCMAKE_SUPPRESS_REGENERATION=TRUE `
409 -DCMAKE_C_FLAGS="/arm64EC" `
410 -DCMAKE_CXX_FLAGS="/arm64EC" `
411 -DCMAKE_EXE_LINKER_FLAGS="/MACHINE:ARM64EC" `
412 -DCMAKE_SHARED_LINKER_FLAGS="/MACHINE:ARM64EC" `
413 -DCMAKE_STATIC_LINKER_FLAGS="/MACHINE:ARM64EC" `
414 -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}"
415 Start-Sleep -Seconds 2
416 cmake --build build_arm64ec --config Release --verbose
417
418 mingw:
419 needs: [src]
420 runs-on: ubuntu-24.04 # FIXME: current ubuntu-latest ships an outdated mingw, replace with ubuntu-latest once 24.04 becomes the new default
421 outputs:
422 mingw-devel-tar-gz: ${{ steps.releaser.outputs.mingw-devel-tar-gz }}
423 mingw-devel-tar-xz: ${{ steps.releaser.outputs.mingw-devel-tar-xz }}
424 steps:
425 - name: 'Set up Python'
426 uses: actions/setup-python@v5
427 with:
428 python-version: '3.11'
429 - name: 'Fetch build-release.py'
430 uses: actions/checkout@v4
431 with:
432 sparse-checkout: 'build-scripts/build-release.py'
433 - name: 'Install Mingw toolchain'
434 run: |
435 sudo apt-get update -y
436 sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
437 - name: 'Download source archives'
438 uses: actions/download-artifact@v4
439 with:
440 name: sources
441 path: '${{ github.workspace }}'
442 - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
443 id: tar
444 run: |
445 mkdir -p /tmp/tardir
446 tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
447 echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
448 - name: 'Build MinGW binary archives'
449 id: releaser
450 run: |
451 python build-scripts/build-release.py \
452 --actions mingw \
453 --commit ${{ inputs.commit }} \
454 --root "${{ steps.tar.outputs.path }}" \
455 --github \
456 --debug
457 - name: 'Store MinGW archives'
458 uses: actions/upload-artifact@v4
459 with:
460 name: mingw
461 path: '${{ github.workspace }}/dist'
462
463 mingw-verify:
464 needs: [mingw, src]
465 runs-on: ubuntu-latest
466 steps:
467 - name: 'Install Mingw toolchain'
468 run: |
469 sudo apt-get update -y
470 sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
471 - name: 'Download source archives'
472 uses: actions/download-artifact@v4
473 with:
474 name: sources
475 path: '${{ github.workspace }}'
476 - name: 'Download MinGW binaries'
477 uses: actions/download-artifact@v4
478 with:
479 name: mingw
480 path: '${{ github.workspace }}'
481 - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
482 id: src
483 run: |
484 mkdir -p /tmp/tardir
485 tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
486 echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
487 - name: 'Untar ${{ needs.mingw.outputs.mingw-devel-tar-gz }}'
488 id: bin
489 run: |
490 mkdir -p /tmp/mingw-tardir
491 tar -C /tmp/mingw-tardir -v -x -f "${{ github.workspace }}/${{ needs.mingw.outputs.mingw-devel-tar-gz }}"
492 echo "path=/tmp/mingw-tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
493 - name: 'CMake (configure + build) i686'
494 run: |
495 cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
496 -DCMAKE_BUILD_TYPE="Release" \
497 -DTEST_FULL=TRUE \
498 -DTEST_STATIC=FALSE \
499 -DTEST_TEST=TRUE \
500 -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" \
501 -DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-i686.cmake" \
502 -DCMAKE_C_FLAGS="-DSDL_DISABLE_SSE4_2" \
503 -Werror=dev \
504 -B build_x86
505 cmake --build build_x86 --config Release --verbose
506 - name: 'CMake (configure + build) x86_64'
507 run: |
508 cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
509 -DCMAKE_BUILD_TYPE="Release" \
510 -DTEST_FULL=TRUE \
511 -DTEST_STATIC=false \
512 -DTEST_TEST=TRUE \
513 -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" \
514 -DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-x86_64.cmake" \
515 -DCMAKE_C_FLAGS="-DSDL_DISABLE_SSE4_2" \
516 -Werror=dev \
517 -B build_x64
518 cmake --build build_x64 --config Release --verbose
519
520 android:
521 needs: [src]
522 runs-on: ubuntu-latest
523 outputs:
524 android-aar: ${{ steps.releaser.outputs.android-aar }}
525 steps:
526 - name: 'Set up Python'
527 uses: actions/setup-python@v5
528 with:
529 python-version: '3.11'
530 - name: 'Fetch build-release.py'
531 uses: actions/checkout@v4
532 with:
533 sparse-checkout: 'build-scripts/build-release.py'
534 - name: 'Setup Android NDK'
535 uses: nttld/setup-ndk@v1
536 with:
537 local-cache: true
538 ndk-version: r21e
539 - name: 'Setup Java JDK'
540 uses: actions/setup-java@v4
541 with:
542 distribution: 'temurin'
543 java-version: '11'
544 - name: 'Install ninja'
545 run: |
546 sudo apt-get update -y
547 sudo apt-get install -y ninja-build
548 - name: 'Download source archives'
549 uses: actions/download-artifact@v4
550 with:
551 name: sources
552 path: '${{ github.workspace }}'
553 - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
554 id: tar
555 run: |
556 mkdir -p /tmp/tardir
557 tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
558 echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
559 - name: 'Build Android prefab binary archive(s)'
560 id: releaser
561 run: |
562 python build-scripts/build-release.py \
563 --actions android \
564 --commit ${{ inputs.commit }} \
565 --root "${{ steps.tar.outputs.path }}" \
566 --github \
567 --debug
568 - name: 'Store Android archive(s)'
569 uses: actions/upload-artifact@v4
570 with:
571 name: android
572 path: '${{ github.workspace }}/dist'
573
574 android-verify:
575 needs: [android, src]
576 runs-on: ubuntu-latest
577 steps:
578 - name: 'Set up Python'
579 uses: actions/setup-python@v5
580 with:
581 python-version: '3.11'
582 - uses: actions/setup-java@v4
583 with:
584 distribution: 'temurin'
585 java-version: '17'
586 - name: 'Download source archives'
587 uses: actions/download-artifact@v4
588 with:
589 name: sources
590 path: '${{ github.workspace }}'
591 - name: 'Download Android .aar archive'
592 uses: actions/download-artifact@v4
593 with:
594 name: android
595 path: '${{ github.workspace }}'
596 - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
597 id: src
598 run: |
599 mkdir -p /tmp/tardir
600 tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
601 echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
602 - name: 'Extract Android SDK from AAR'
603 id: sdk
604 run: |
605 cd /tmp
606 unzip "${{ github.workspace }}/${{ needs.android.outputs.android-aar }}"
607 python "${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" -o /tmp/SDL3-android
608 echo "prefix=/tmp/SDL3-android" >>$GITHUB_OUTPUT
609 echo "sdl3-aar=/tmp/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" >>$GITHUB_OUTPUT
610 - name: 'CMake (configure + build) x86, x64, arm32, arm64'
611 run: |
612 android_abis="x86 x86_64 armeabi-v7a arm64-v8a"
613 for android_abi in ${android_abis}; do
614 echo "Configuring ${android_abi}..."
615 cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
616 -DTEST_FULL=TRUE \
617 -DTEST_STATIC=FALSE \
618 -DTEST_TEST=TRUE \
619 -DCMAKE_PREFIX_PATH="${{ steps.sdk.outputs.prefix }}" \
620 -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
621 -DANDROID_ABI=${android_abi} \
622 -DCMAKE_BUILD_TYPE=Release \
623 -B "${android_abi}"
624 echo "Building ${android_abi}..."
625 cmake --build "${android_abi}" --config Release --verbose
626 done
627 - name: 'Create gradle project'
628 id: create-gradle-project
629 run: |
630 python ${{ steps.src.outputs.path }}/build-scripts/create-android-project.py \
631 org.libsdl.testspriteminimal \
632 ${{ steps.src.outputs.path }}/test/testspriteminimal.c \
633 ${{ steps.src.outputs.path }}/test/icon.h \
634 --variant aar \
635 --output "/tmp/projects"
636 echo "path=/tmp/projects/org.libsdl.testspriteminimal" >>$GITHUB_OUTPUT
637 - name: 'Copy SDL3 aar into Gradle project'
638 run: |
639 cp "${{ steps.sdk.outputs.sdl3-aar }}" "${{ steps.create-gradle-project.outputs.path }}/app/libs"
640
641 echo ""
642 echo "Project contents:"
643 echo ""
644 find "${{ steps.create-gradle-project.outputs.path }}"
645 - name: 'Build app (Gradle & CMake)'
646 run: |
647 cd "${{ steps.create-gradle-project.outputs.path }}"
648 ./gradlew -i assembleRelease -Pandroid.native.buildOutput=verbose -PBUILD_WITH_CMAKE=1
649 - name: 'Build app (Gradle & ndk-build)'
650 run: |
651 cd "${{ steps.create-gradle-project.outputs.path }}"
652 ./gradlew -i assembleRelease -Pandroid.native.buildOutput=verbose