Skip to content

Update jgl to 0-0.0.8 #127

Update jgl to 0-0.0.8

Update jgl to 0-0.0.8 #127

Workflow file for this run

name: Hop release
on:
push:
branches: [ "main" ]
tags: 'v*'
paths-ignore:
- 'doc/**'
- '.github/**'
workflow_dispatch:
pull_request:
jobs:
headers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: pack headers
run: |
ls
mkdir headers
for inc in include/jGL/include/jGL \
include/jGL/include/*.h \
include/jGL/include/vendored/freetype/include/* \
include/jGL/include/vendored/glew/include/GL \
include/jGL/include/vendored/glfw/include/GLFW \
include/jGL/include/vendored/glm/glm \
include/jGL/include/vendored/stduuid/include/uuid.h \
include/jGL/include/vendored/stduuid/gsl \
include/jGL/include/vendored/stb_image.h \
include/jLog \
include/jThread \
include/Collision \
include/Component \
include/Console \
include/Debug \
include/Maths \
include/Object \
include/Shader \
include/System \
include/Util \
include/World \
include/vendored/lua/src/lauxlib.h \
include/vendored/lua/src/lua.h \
include/vendored/lua/src/luaconf.h \
include/vendored/lua/src/lualib.h \
include/vendored/miniaudio \
include/vendored/json.hpp \
include/*.h \
include/vendored/vorbis/include/vorbis \
include/vendored/ogg/include/ogg \
include/vendored/sparsehash;
do cp -r $inc headers; done
ls headers
- name: pack headers mingw
run: |
ls
mkdir headers-mingw
cp -r headers/* headers-mingw
mkdir headers-mingw/VulkanSDK
cp -r include/jGL/include/vendored/VulkanSDK/Include headers-mingw/VulkanSDK/
cp -r include/jGL/include/vendored/VulkanSDK/Windows headers-mingw/VulkanSDK/
ls headers-mingw
- name: build header artifact
uses: actions/upload-artifact@v4
with:
name: headers
path: headers
- name: build header-mingw artifact
uses: actions/upload-artifact@v4
with:
name: headers-mingw
path: headers-mingw
linuxNative:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- 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 vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools
- name: linux-linux
run: |
git submodule update --recursive
./build.sh -t -d -r
mkdir linuxbuild
cp build/libHop.a linuxbuild/libHop-linux-x86_64.a
cp build/libjGL.a linuxbuild/libjGL-linux-x86_64.a
cp LICENSE* linuxbuild/
mkdir demos
cp -r build/PerlinWorld demos/
cd demos && zip -r ../demos.zip * && cd ..
- 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 --output-on-failure --verbose
- name: buildArtifact
uses: actions/upload-artifact@v4
with:
name: linuxbuild
path: linuxbuild
- name: demoArtifact
uses: actions/upload-artifact@v4
with:
name: demoLinux
path: demos.zip
linuxXwindows:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- 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 wine64
- name: linux-X-windows
run: |
git submodule update --recursive
./build.sh -w -d -r -t
mkdir windowsbuild
cp build/libHop.a windowsbuild/libHop-windows.a
cp build/libjGL.a windowsbuild/libjGL-windows.a
cp build/*.dll windowsbuild/
cp LICENSE* windowsbuild/
mkdir demos
cp -r build/PerlinWorld demos/
cp build/*.dll demos/PerlinWorld/
cd demos && zip -r ../demos.zip * && cd ..
cp build/*.dll build/TestScriptPack/
- name: Tests (wine64)
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: |
cp *.dll TestAssetStore/
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ctest --output-on-failure --verbose --exclude-regex Vulkan
- name: buildArtifact
uses: actions/upload-artifact@v4
with:
name: windowsbuild
path: windowsbuild
- name: demoArtifact
uses: actions/upload-artifact@v4
with:
name: demoWindows
path: demos.zip
macosNative:
runs-on: macos-12
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install dependencies
run: |
wget https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg
hdiutil attach vulkan-sdk.dmg -mountpoint /Volumes/vulkan-sdk
mkdir ~/vulkan
cd /Volumes/vulkan-sdk/
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 build
run: |
git submodule update --recursive
./build.sh -o -d -r -t
mkdir macosbuild
cp build/libHop.a macosbuild/libHop-macos.a
cp build/libjGL.a macosbuild/libjGL-macos.a
cp LICENSE* macosbuild/
mkdir demos
cp -r build/PerlinWorld demos/
cd demos && zip -r ../demos.zip * && cd ..
- 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: MESA_GL_VERSION_OVERRIDE=3.3 ctest --output-on-failure --verbose --exclude-regex Vulkan --exclude-regex assetStore
- name: buildArtifact
uses: actions/upload-artifact@v4
with:
name: macosbuild
path: macosbuild
- name: demoArtifact
uses: actions/upload-artifact@v4
with:
name: demomacos
path: demos.zip
linuxRun:
needs: linuxNative
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y xvfb x11-apps imagemagick
- name: get linux demos
uses: actions/download-artifact@v4
with:
name: demoLinux
- name: launch and screenshot
run: |
unzip demos.zip
cd PerlinWorld
chmod +x PerlinWorld
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ./PerlinWorld &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot.png
sleep 5 && kill $PID
MESA_GL_VERSION_OVERRIDE=3.3 ./PerlinWorld map &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot-map.png
sleep 5 && kill $PID
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: screenshot
path: PerlinWorld/screenshot.png
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: screenshot-map
path: PerlinWorld/screenshot-map.png
linuxXandroid:
needs: [headers]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools
wget https://dl.google.com/android/repository/android-ndk-r25c-linux.zip
unzip android-ndk-r25c-linux.zip
wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
unzip commandlinetools-linux-9477386_latest.zip
export ANDROID_SDK_ROOT=~/
mv cmdline-tools latest
mkdir cmdline-tools
mv latest cmdline-tools
yes | ./cmdline-tools/latest/bin/sdkmanager --licenses
./cmdline-tools/latest/bin/sdkmanager --channel=3 emulator
./cmdline-tools/latest/bin/sdkmanager --install "system-images;android-34;google_apis;x86_64"
./cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-34"
echo no | ./cmdline-tools/latest/bin/avdmanager create avd --name android34 --package "system-images;android-34;google_apis;x86_64"
- name: build hop
run: |
git submodule update --recursive
./build.sh -r --android android-ndk-r25c
mkdir androidbuild
cp build/libHop* androidbuild/
cp build/libjGL* androidbuild/
cp LICENSE* androidbuild/
- name: buildArtifact
uses: actions/upload-artifact@v4
with:
name: androidbuild
path: androidbuild
- name: get headers
uses: actions/download-artifact@v4
with:
name: headers
path: headers/
- name: build demo
run: |
cp -r headers/ demo/android/perlinWorld/app/src/main/cpp/include/
cp -r build/*.a demo/android/perlinWorld/app/src/main/cpp/include/
cd demo/android/perlinWorld
./gradlew assembleDebug
cd ~/
# emulator not being created in setup
# get em next time..
# - name: linux-android-run
# run: |
# echo $(ls .android/avd)
# export DISPLAY=:99
# sudo Xvfb :99 -screen 0 800x600x24 &
# sleep 5
# export ANDROID_SDK_ROOT=~/ && ./emulator/emulator -avd android33 &
# export PID=$!
# sleep 10
# export ANDROID_SDK_ROOT=~/ && ./platform-tools/adb install demo/android/perlinWorld/app/release/app-release.aab
# xwd -root -silent | convert xwd:- png:screenshot-android.png
# sleep 5 && kill $PID
- name: demoAndroid
uses: actions/upload-artifact@v4
with:
name: demoAndroid
path: demo/android/perlinWorld/app/release/*.aab
# - name: upload artifact
# uses: actions/upload-artifact@v4
# with:
# name: screenshot-android
# path: screenshot-android.png
test-release:
needs: [linuxNative, headers]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: get headers
uses: actions/download-artifact@v4
with:
name: headers
path: headers/
- name: get linux build
uses: actions/download-artifact@v4
with:
name: linuxbuild
- 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 lib test
run: |
ls
mv libHop-linux-x86_64.a libHop.a
mv libjGL-linux-x86_64.a libjGL.a
mkdir tests/regression/user/include/
cp *.a tests/regression/user/
cp -r headers/* tests/regression/user/include/
cd tests/regression/user
ls
mkdir build && cd build
cmake .. && make
test-release-mingw:
needs: [linuxXwindows, headers]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: get headers
uses: actions/download-artifact@v4
with:
name: headers-mingw
path: headers/
- name: get windows build
uses: actions/download-artifact@v4
with:
name: windowsbuild
- 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 libz-mingw-w64-dev libxinerama-dev libxcursor-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools xvfb x11-apps imagemagick
- name: mingw lib test
run: |
ls
mv libHop-windows.a libHop.a
mv libjGL-windows.a libjGL.a
mkdir tests/regression/user-mingw/include/
cp *.a tests/regression/user-mingw/
cp -r headers/* tests/regression/user-mingw/include/
cd tests/regression/user-mingw
./build.sh
test-release-macos:
needs: [macosNative, headers]
runs-on: macos-12
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: get headers
uses: actions/download-artifact@v4
with:
name: headers
path: headers/
- name: get macos build
uses: actions/download-artifact@v4
with:
name: macosbuild
- name: Install dependencies
run: |
wget https://sdk.lunarg.com/sdk/download/latest/mac/vulkan-sdk.dmg
hdiutil attach vulkan-sdk.dmg -mountpoint /Volumes/vulkan-sdk
mkdir ~/vulkan
cd /Volumes/vulkan-sdk/
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 lib test
run: |
ls
mv libHop-macos.a libHop.a
mv libjGL-macos.a libjGL.a
mkdir tests/regression/user-macos/include/
cp *.a tests/regression/user-macos/
cp -r headers/* tests/regression/user-macos/include/
cd tests/regression/user-macos
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../osx.cmake && make
release:
needs: [linuxNative, linuxXwindows, linuxXandroid, macosNative, headers]
if: github.ref_type == 'tag'
runs-on: ubuntu-20.04
steps:
- name: get linux build
uses: actions/download-artifact@v4
with:
name: linuxbuild
path: linux
- name: get windows build
uses: actions/download-artifact@v4
with:
name: windowsbuild
path: windows
- name: get macos build
uses: actions/download-artifact@v4
with:
name: macosbuild
path: macos
- name: get android build
uses: actions/download-artifact@v4
with:
name: androidbuild
path: android
- name: get headers
uses: actions/download-artifact@v4
with:
name: headers
path: headers/
- name: get headers-mingw
uses: actions/download-artifact@v4
with:
name: headers-mingw
path: headers-mingw/
- name: pack
run: |
ls
zip -r linux.zip linux
zip -r macos.zip macos
zip -r windows.zip windows
zip -r android.zip android
zip -r headers.zip headers
zip -r headers-mingw.zip headers-mingw
- name: release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: true
name: "release-${{ github.ref_name }}"
tag_name: ${{ github.ref }}
files: |
linux.zip
windows.zip
macos.zip
android.zip
headers.zip
headers-mingw.zip