Skip to content

Update sample for API changes #563

Update sample for API changes

Update sample for API changes #563

Workflow file for this run

name: Build-Samples
on: push
jobs:
build-linux:
name: Build Samples for Linux x64
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y lsb-release wget software-properties-common apt-utils
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository -y "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt-get update -y
sudo apt remove build-essential -y
sudo apt-get install cmake g++-13 fuse libfuse2 ninja-build vulkan-sdk libgl1-mesa-dev libgtk-3-dev libasound2-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libegl1-mesa-dev libvulkan-dev libx11-xcb-dev libxcb-dri2-0-dev libxcb-glx0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-randr0-dev libxrandr-dev libxxf86vm-dev mesa-common-dev -y --no-install-recommends
- name: Configure
run: |
mkdir -p build
mkdir -p build/linux
cd build/linux
export CC=/usr/bin/gcc-13
export CXX=/usr/bin/g++-13
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DRAVENGINE_BUILD_TESTS=OFF ../..
- name: Build
run: cd build/linux && cmake --build . --config release --target install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_linux64
path: build/linux/Release/*.AppImage
- name: Prepare Transfer upload
run: cd build/linux/Release ; zip -r -9 Samples.zip *.AppImage
- name: Upload to Transfer.sh
run: URL=`curl --upload-file build/linux/Release/Samples.zip https://transfer.sh/RavEngine_Samples_linux.zip` ; echo "::notice file=.github/workflows/build.yml::$URL" | sed "s/.sh/.sh\/get/g"
continue-on-error: true
build-linux-arm:
name: Build Samples for Linux arm64
runs-on: ubuntu-latest
if: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Repositories
run: sudo mv config/crosscomp-sources.list /etc/apt/sources.list;
- name: Check apt sources
run: cat /etc/apt/sources.list
- name: Add arm64 as architecture
run: sudo dpkg --add-architecture arm64
- name: Update APT
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
continue-on-error: true
- name: Install Host Dependencies
run: sudo apt-get install cmake:amd64 fuse:amd64 libfuse2:amd64 ninja-build:amd64 libx11-dev:amd64 libgl1-mesa-dev gcc-13:amd64 g++-13:amd64 gcc-13-aarch64-linux-gnu:amd64 g++-13-aarch64-linux-gnu:amd64 -y --no-install-recommends
- name: Install Target Dependencies
run: sudo apt-get install libgl1-mesa-dev:arm64 libasound2-dev:arm64 libx11-dev:arm64 libxext-dev:arm64 libxrender-dev:arm64 libxrandr-dev:arm64 libxtst-dev:arm64 libxt-dev:arm64 libegl1-mesa-dev:arm64 libx11-xcb-dev:arm64 libxcb-dri2-0-dev:arm64 libxcb-glx0-dev:arm64 libxcb-icccm4-dev:arm64 libxcb-keysyms1-dev:arm64 libxcb-randr0-dev:arm64 libxrandr-dev:arm64 libxxf86vm-dev:arm64 mesa-common-dev:arm64 -y --no-install-recommends
- name: Configure
run: |
mkdir -p build
mkdir -p build/linuxarm
cd build/linuxarm
CC=/usr/bin/aarch64-linux-gnu-gcc-13 CXX=/usr/bin/aarch64-linux-gnu-g++-13 cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DRAVENGINE_BUILD_TESTS=OFF ../..
- name: Build
run: cd build/linuxarm && cmake --build . --config release --target install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_linuxARM
path: build/linuxarm/Release/*.AppImage
- name: Prepare Transfer upload
run: cd build/linuxarm/Release ; zip -r -9 Samples.zip *.AppImage
- name: Upload to Transfer.sh
run: URL=`curl --upload-file build/linuxarm/Release/Samples.zip https://transfer.sh/RavEngine_Samples_linuxARM.zip` ; echo "::notice file=.github/workflows/build.yml::$URL" | sed "s/.sh/.sh\/get/g"
continue-on-error: true
build-emscripten:
name: Build samples for Emscripten-Linux
runs-on: ubuntu-latest
if: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install cmake clang python3 libgl1-mesa-dev libwayland-dev libxkbcommon-dev libegl-dev -y --no-install-recommends
- name: Setup Emscripten
run: git clone https://github.com/emscripten-core/emsdk.git --depth=1 && cd emsdk && ./emsdk install latest && ./emsdk activate latest && source ./emsdk_env.sh
- name: Configure
run: mkdir -p build && cd build; cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake ..
- name: Build
run: cd build; cmake --build . --config Release --target install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_Web
path: |
build/Release/*.js
build/Release/*.html
build/Release/*.wasm
build/Release/*.data
- name: Prepare Transfer upload
run: cd build/Release ; zip -r -9 Samples.zip *.js *.html *.wasm *.data
- name: Upload to Transfer.sh
run: URL=`curl --upload-file build/Release/Samples.zip https://transfer.sh/RavEngine_Samples_Web.zip` ; echo "::notice file=.github/workflows/build.yml::$URL" | sed "s/.sh/.sh\/get/g"
continue-on-error: true
build-apple:
name: Build Samples for Apple arm64 Platforms (unsigned)
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
platform: [iOS, tvOS, '']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1.6.0
with:
xcode-version: "15.3"
- name: Configure
run: |
mkdir -p build
cd build
cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=${{ matrix.platform }} -DRAVENGINE_BUILD_TESTS=OFF -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED="NO" -DCMAKE_OSX_ARCHITECTURES="arm64" ..
- name: Build
run: cd build; cmake --build . --config release --target install -- -quiet
- name: Free space
run: |
cd build
rm -rf build RavEngine host-tools *.build/ release/protoc release/rglc
- name: Create DMG
run: |
cd build
touch release/.Trash
hdiutil create -size 2g -srcfolder release -volname RavEngine_Samples_Apple_${{ matrix.platform }} RavEngine_Samples_Apple_${{ matrix.platform }}.dmg
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_Apple_${{ matrix.platform }}
path: build/RavEngine_Samples_Apple_${{ matrix.platform }}.dmg
- name: Upload to Transfer.sh
run: URL=`curl --upload-file build/RavEngine_Samples_Apple_${{ matrix.platform }}.dmg https://transfer.sh/RavEngine_Samples_Apple_${{ matrix.platform }}.dmg` ; echo "::notice file=.github/workflows/build.yml::$URL" | sed "s/.sh/.sh\/get/g"
continue-on-error: true
build-windows:
name: Build samples for Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x64, ARM64]
sdk: [Windows]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Configure
run: |
mkdir build
cd build
mkdir win
cd win
cmake -A${{ matrix.arch }} -DCMAKE_SYSTEM_NAME=${{ matrix.sdk }} -DCMAKE_SYSTEM_VERSION="10.0" -DCMAKE_BUILD_TYPE=Release -DRAVENGINE_BUILD_TESTS=OFF ..\..
cmake -Wno-dev ..\..
- name: Build
run: cd build; cd win; cmake --build . --config release --target install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_Win${{ matrix.arch }}
path: |
build\win\release\RavEngine*.exe
build\win\release\RavEngine*.rvedata
build\win\release\RavEngine*Streaming\*
- name: Prepare Transfer.sh upload
run: Compress-Archive -Path build\win\release\*.exe,build\win\release\*.rvedata,build\win\release\*Streaming\ -DestinationPath Samples${{ matrix.arch }}.zip
- name: Upload to Transfer.sh
run: $URL = Invoke-RestMethod -Uri https://transfer.sh/RavEngine_Samples_Win${{ matrix.arch }}.zip -Method PUT -InFile Samples${{ matrix.arch }}.zip -UseDefaultCredentials ; echo "::notice file=.github/workflows/build.yml::$URL" | %{$_ -replace ".sh",".sh/get"}
continue-on-error: true
build-uwp:
name: Build samples for UWP
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x64, ARM64]
sdk: [WindowsStore]
steps:
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Configure
run: |
mkdir build
cd build
mkdir uwp
cd uwp
cmake -A${{ matrix.arch }} -DCMAKE_SYSTEM_NAME=${{ matrix.sdk }} -DCMAKE_SYSTEM_VERSION="10.0" -DCMAKE_BUILD_TYPE=Release -Wno-dev -DRAVENGINE_BUILD_TESTS=OFF ..\..
cmake -Wno-dev ..\..;
- name: Build & Publish
run: |
cd build\uwp
& "MSbuild.exe" "RavEngine_Samples_WindowsStore.sln" /p:Configuration=Release /p:AppxBundle=Always /p:AppxBundlePlatforms="${{ matrix.arch }}"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_${{ matrix.sdk }}_${{ matrix.arch }}
path: build\uwp\AppPackages
- name: Prepare Transfer.sh upload
run: |
Move-Item -Path build\uwp\AppPackages\ -Destination .
Remove-Item -Path build -Recurse
Compress-Archive -Path AppPackages\ -DestinationPath Samples${{ matrix.sdk }}_${{ matrix.arch }}.zip
- name: Upload to Transfer.sh
run: $URL = Invoke-RestMethod -Uri https://transfer.sh/RavEngine_Samples_${{ matrix.sdk }}_${{ matrix.arch }}.zip -Method PUT -InFile Samples${{ matrix.sdk }}_${{ matrix.arch }}.zip -UseDefaultCredentials ; echo "::notice file=.github/workflows/build.yml::$URL" | %{$_ -replace ".sh",".sh/get"}
continue-on-error: true