@@ -210,47 +210,37 @@ jobs:
210210 # 1.4G
211211 sudo rm -rf /usr/share/dotnet
212212 df -h
213- # Ubuntu 24.04 だと libtinfo5 が見つからない問題があるので、その修正
214- # ref: https://qiita.com/gengen16k/items/88cf3c18a40a94205fab
215- - name : Fix CUDA issues for Ubuntu 24.04
216- if : matrix.platform.name == 'ubuntu-24.04_x86_64'
217- run : |
218- sudo tee /etc/apt/sources.list.d/jammy.list << EOF
219- deb http://archive.ubuntu.com/ubuntu/ jammy universe
220- EOF
221-
222- sudo tee /etc/apt/preferences.d/pin-jammy <<EOF
223- Package: *
224- Pin: release n=jammy
225- Pin-Priority: -10
226-
227- Package: libtinfo5
228- Pin: release n=jammy
229- Pin-Priority: 990
230- EOF
231- - name : Install deps for ${{ matrix.platform.name }}
213+ - name : Install base deps for ${{ matrix.platform.name }}
232214 if : matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'x86_64'
233215 run : |
234- source DEPS
235216 sudo apt-get update
236217 sudo apt-get install -y software-properties-common
237-
238- # X11
239- sudo apt-get install libx11-dev libxext-dev
240-
241- # OpenGL
218+ - name : Install X11 for ${{ matrix.platform.name }}
219+ if : matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'x86_64'
220+ run : |
221+ sudo apt-get install -y libx11-dev libxext-dev
222+ - name : Install OpenGL for ${{ matrix.platform.name }}
223+ if : matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'x86_64'
224+ run : |
242225 sudo apt-get install -y libgl-dev
243226
244- # CUDA
245- # libssl1.1 が必要
246- wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
247- sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
248- wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
249- sudo dpkg -i cuda-keyring_*all.deb
250- sudo apt-get update
251- DEBIAN_FRONTEND=noninteractive sudo apt-get -y install cuda=$CUDA_VERSION
227+ - name : Get CUDA version from DEPS
228+ if : matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'x86_64'
229+ id : cuda-version
230+ run : |
231+ CUDA_VERSION=$(grep '^CUDA_VERSION=' DEPS | cut -d= -f2)
232+ echo "cuda_version=$CUDA_VERSION" >> $GITHUB_OUTPUT
233+
234+ - uses : shiguredo/github-actions/.github/actions/setup-cuda-toolkit@main
235+ if : matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'x86_64'
236+ id : cuda
237+ with :
238+ cuda_version : ${{ steps.cuda-version.outputs.cuda_version }}
239+ platform : ${{ matrix.platform.runs-on }}
252240
253- # clang-20
241+ - name : Install clang-20 for ${{ matrix.platform.name }}
242+ if : matrix.platform.os == 'ubuntu' && matrix.platform.arch == 'x86_64'
243+ run : |
254244 wget https://apt.llvm.org/llvm.sh
255245 chmod a+x llvm.sh
256246 sudo ./llvm.sh 20
@@ -269,14 +259,14 @@ jobs:
269259 sudo apt-get -y install ninja-build
270260 # JDK を指定しないとデフォルトの JDK 11 で動作するため指定する
271261 - name : Setup JDK 17
262+ if : matrix.platform.os == 'android'
272263 uses : actions/setup-java@v4
273264 with :
274- java-version : ' 17'
275- distribution : ' temurin'
276- if : matrix.platform.os == 'android'
265+ java-version : " 17"
266+ distribution : " temurin"
277267 - name : Setup Android SDK
278- uses : android-actions/setup-android@v3
279268 if : matrix.platform.os == 'android'
269+ uses : android-actions/setup-android@v3
280270 - run : python3 run.py build --test --run-e2e-test --package ${{ matrix.platform.name }}
281271 - name : Get package name
282272 run : |
@@ -300,15 +290,16 @@ jobs:
300290 name : ${{ matrix.platform.name }}.env
301291 path : _package/${{ matrix.platform.name }}/release/sora.env
302292 - name : Build Examples
293+ if : matrix.platform.os == 'ubuntu' && matrix.platform.name != 'ubuntu-22.04_armv8'
303294 run : |
304295 cd examples
305296 mkdir examples_${{ matrix.platform.name }}
306297 for app in sdl_sample sumomo messaging_recvonly_sample; do
307298 python3 $app/${{ matrix.platform.name }}/run.py --local-sora-cpp-sdk-dir ..
308299 cp _build/${{ matrix.platform.name }}/release/$app/$app examples_${{ matrix.platform.name }}
309300 done
310- if : matrix.platform.os == 'ubuntu' && matrix.platform.name != 'ubuntu-22.04_armv8'
311- - name : Build Examples
301+ - name : Build Examples (Raspberry Pi OS)
302+ if : matrix.platform.os == 'raspberry-pi-os' && matrix.platform.arch == 'armv8'
312303 run : |
313304 cd examples
314305 mkdir examples_${{ matrix.platform.name }}
@@ -318,13 +309,14 @@ jobs:
318309 # raspberry-pi-os は libcamerac.so も必要
319310 cp _build/${{ matrix.platform.name }}/release/$app/libcamerac.so examples_${{ matrix.platform.name }}
320311 done
321- if : matrix.platform.os == 'raspberry-pi-os' && matrix.platform.arch == 'armv8'
322312 - name : Upload Examples Artifact
313+ if : |
314+ (matrix.platform.os == 'ubuntu' && matrix.platform.name != 'ubuntu-22.04_armv8') ||
315+ (matrix.platform.os == 'raspberry-pi-os')
323316 uses : actions/upload-artifact@v4
324317 with :
325318 name : examples_${{ matrix.platform.name }}
326319 path : examples/examples_${{ matrix.platform.name }}
327- if : matrix.platform.os == 'ubuntu' && matrix.platform.name != 'ubuntu-22.04_armv8'
328320
329321 create-release :
330322 name : Create Release
@@ -398,24 +390,24 @@ jobs:
398390 working-directory : ${{ github.workspace }}/examples
399391 runs-on : windows-2022
400392 steps :
401- - uses : actions/checkout@v5
402- - name : Build Example
403- run : |
404- python3 ${{ matrix.example }}/windows_x86_64/run.py
405- - name : Package Binary
406- run : |
407- # アップロード用のディレクトリを作成する
408- mkdir -p ${{ matrix.example }}_windows_x86_64
409- # バイナリをアップロード用のディレクトリにコピーする
410- cp _build/windows_x86_64/release/${{ matrix.example }}/Release/${{ matrix.example }}.exe ${{ matrix.example }}_windows_x86_64/${{ matrix.example }}.exe
411- # バイナリを圧縮する
412- # 例: sumomo_windows_x86_64.zip
413- Compress-Archive -Path ${{ matrix.example }}_windows_x86_64 -DestinationPath ${{ matrix.example }}_windows_x86_64.zip
414- - name : Upload Examples Artifact
415- uses : actions/upload-artifact@v4
416- with :
417- name : ${{ matrix.example }}_windows_x86_64.zip
418- path : examples/${{ matrix.example }}_windows_x86_64.zip
393+ - uses : actions/checkout@v5
394+ - name : Build Example
395+ run : |
396+ python3 ${{ matrix.example }}/windows_x86_64/run.py
397+ - name : Package Binary
398+ run : |
399+ # アップロード用のディレクトリを作成する
400+ mkdir -p ${{ matrix.example }}_windows_x86_64
401+ # バイナリをアップロード用のディレクトリにコピーする
402+ cp _build/windows_x86_64/release/${{ matrix.example }}/Release/${{ matrix.example }}.exe ${{ matrix.example }}_windows_x86_64/${{ matrix.example }}.exe
403+ # バイナリを圧縮する
404+ # 例: sumomo_windows_x86_64.zip
405+ Compress-Archive -Path ${{ matrix.example }}_windows_x86_64 -DestinationPath ${{ matrix.example }}_windows_x86_64.zip
406+ - name : Upload Examples Artifact
407+ uses : actions/upload-artifact@v4
408+ with :
409+ name : ${{ matrix.example }}_windows_x86_64.zip
410+ path : examples/${{ matrix.example }}_windows_x86_64.zip
419411
420412 build-macos-examples :
421413 needs : create-release
@@ -428,23 +420,23 @@ jobs:
428420 working-directory : ${{ github.workspace }}/examples
429421 runs-on : macos-14
430422 steps :
431- - uses : actions/checkout@v5
432- - name : Build Example
433- run : |
434- python3 ${{ matrix.example }}/macos_arm64/run.py
435- - name : Package Binary
436- run : |
437- # アップロード用のディレクトリを作成する
438- mkdir -p ${{ matrix.example }}_macos_arm64
439- cp _build/macos_arm64/release/${{ matrix.example }}/${{ matrix.example }} ${{ matrix.example }}_macos_arm64/${{ matrix.example }}
440- # バイナリを圧縮する
441- # 例: sumomo_macos_arm64.tar.gz
442- tar -czf ${{ matrix.example }}_macos_arm64.tar.gz ${{ matrix.example }}_macos_arm64
443- - name : Upload Examples Artifact
444- uses : actions/upload-artifact@v4
445- with :
446- name : ${{ matrix.example }}_macos_arm64.tar.gz
447- path : examples/${{ matrix.example }}_macos_arm64.tar.gz
423+ - uses : actions/checkout@v5
424+ - name : Build Example
425+ run : |
426+ python3 ${{ matrix.example }}/macos_arm64/run.py
427+ - name : Package Binary
428+ run : |
429+ # アップロード用のディレクトリを作成する
430+ mkdir -p ${{ matrix.example }}_macos_arm64
431+ cp _build/macos_arm64/release/${{ matrix.example }}/${{ matrix.example }} ${{ matrix.example }}_macos_arm64/${{ matrix.example }}
432+ # バイナリを圧縮する
433+ # 例: sumomo_macos_arm64.tar.gz
434+ tar -czf ${{ matrix.example }}_macos_arm64.tar.gz ${{ matrix.example }}_macos_arm64
435+ - name : Upload Examples Artifact
436+ uses : actions/upload-artifact@v4
437+ with :
438+ name : ${{ matrix.example }}_macos_arm64.tar.gz
439+ path : examples/${{ matrix.example }}_macos_arm64.tar.gz
448440
449441 build-ubuntu-examples :
450442 needs : create-release
@@ -510,35 +502,35 @@ jobs:
510502 path : examples/${{ matrix.example }}_${{ matrix.platform.name }}.tar.gz
511503
512504 create-release-example :
513- name : Create Release Examples
514- needs :
515- - build-windows-examples
516- - build-macos-examples
517- - build-ubuntu-examples
518- strategy :
519- matrix :
520- example :
521- - sumomo
522- archive :
523- - windows_x86_64.zip
524- - macos_arm64.tar.gz
525- - ubuntu-22.04_x86_64.tar.gz
526- - ubuntu-24.04_x86_64.tar.gz
527- - ubuntu-24.04_armv8.tar.gz
528- - raspberry-pi-os_armv8.tar.gz
529- runs-on : ubuntu-24.04
530- steps :
531- - uses : actions/checkout@v5
532- - uses : actions/download-artifact@v5
533- with :
534- name : ${{ matrix.example }}_${{ matrix.archive }}
535- - name : Release Examples
536- run : |
537- gh release upload "${{ github.ref_name }}" \
538- "${{ matrix.example }}_${{ matrix.archive }}" \
539- --clobber
540- env :
541- GH_TOKEN : ${{ github.token }}
505+ name : Create Release Examples
506+ needs :
507+ - build-windows-examples
508+ - build-macos-examples
509+ - build-ubuntu-examples
510+ strategy :
511+ matrix :
512+ example :
513+ - sumomo
514+ archive :
515+ - windows_x86_64.zip
516+ - macos_arm64.tar.gz
517+ - ubuntu-22.04_x86_64.tar.gz
518+ - ubuntu-24.04_x86_64.tar.gz
519+ - ubuntu-24.04_armv8.tar.gz
520+ - raspberry-pi-os_armv8.tar.gz
521+ runs-on : ubuntu-24.04
522+ steps :
523+ - uses : actions/checkout@v5
524+ - uses : actions/download-artifact@v5
525+ with :
526+ name : ${{ matrix.example }}_${{ matrix.archive }}
527+ - name : Release Examples
528+ run : |
529+ gh release upload "${{ github.ref_name }}" \
530+ "${{ matrix.example }}_${{ matrix.archive }}" \
531+ --clobber
532+ env :
533+ GH_TOKEN : ${{ github.token }}
542534
543535 notification :
544536 name : Slack Notification
0 commit comments