Skip to content

restore drag in rotational motion, object mass distributed through pa… #59

restore drag in rotational motion, object mass distributed through pa…

restore drag in rotational motion, object mass distributed through pa… #59

Workflow file for this run

name: Hop
on:
push:
branches: [ "main" ]
tags: 'v*'
paths-ignore:
- 'doc/**'
- '.github/**'
pull_request:
workflow_dispatch:
jobs:
linuxXlinux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- 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
- name: linux-linux
run: |
./dependencies.sh && ./build.sh -t -d -r
mkdir linuxbuild
cp build/libHop.a linuxbuild/
cp -r include linuxbuild/
cd linuxbuild && zip -r ../linuxbuild.zip * && cd ..
mkdir demos && mkdir demos/sfml && mkdir demos/standalone
cp build/sfmlPerlinWorld demos/sfml
cp tile.hmap demos/sfml/
cp config.lua demos/sfml
cp build/perlinWorld demos/standalone
cp tile.hmap demos/standalone
cp config.lua demos/standalone
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: ctest
- name: buildArtifact
uses: actions/upload-artifact@v3
with:
name: linuxbuild
path: linuxbuild.zip
- name: demoArtifact
uses: actions/upload-artifact@v3
with:
name: demoLinux
path: demos.zip
linuxXwindows:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- 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
- name: linux-X-windows
run: |
./dependencies.sh -w && ./build.sh -w -d -r
mkdir windowsbuild
cp build/libHop.a windowsbuild/
cp -r include windowsbuild/
cd windowsbuild && zip -r ../windowsbuild.zip * && cd ..
mkdir demos && mkdir demos/sfml && mkdir demos/standalone
cp build/sfmlPerlinWorld.exe demos/sfml
cp tile.hmap demos/sfml/
cp build/perlinWorld.exe demos/standalone
cp tile.hmap demos/standalone
cp -r build/*.dll demos/sfml
cd demos && zip -r ../demos.zip * && cd ..
- name: buildArtifact
uses: actions/upload-artifact@v3
with:
name: windowsbuild
path: windowsbuild.zip
- name: demoArtifact
uses: actions/upload-artifact@v3
with:
name: demoWindows
path: demos.zip
linuxRun:
needs: linuxXlinux
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@v3
with:
name: demoLinux
- name: launch and screenshot
run: |
unzip demos.zip
cd sfml
chmod +x sfmlPerlinWorld
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ./sfmlPerlinWorld &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot.png
sleep 5 && kill $PID
MESA_GL_VERSION_OVERRIDE=3.3 ./sfmlPerlinWorld map &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot-map.png
sleep 5 && kill $PID
cd ../standalone
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@v3
with:
name: screenshot-standalone
path: standalone/screenshot.png
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: screenshot-map-standalone
path: standalone/screenshot-map.png
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: screenshot-sfml
path: sfml/screenshot.png
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: screenshot-map-sfml
path: sfml/screenshot-map.png
linuxXandroid:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- 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
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 --install "system-images;android-33;google_apis;x86_64"
./cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-33"
echo no | ./cmdline-tools/latest/bin/avdmanager create avd --name android33 --package "system-images;android-33;google_apis;x86_64"
- name: linux-android-hop
run: |
./build.sh -r --android android-ndk-r25c
mkdir androidbuild
cp build/libHop* androidbuild/
cp -r include androidbuild/
cd androidbuild && zip -r ../androidbuild.zip * && cd ..
- name: buildArtifact
uses: actions/upload-artifact@v3
with:
name: androidbuild
path: androidbuild.zip
- name: linux-android-demo
run: |
cp -r build/*.a demo/android/perlinWorld/app/src/main/cpp/include/
cp -r include/* 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@v3
with:
name: demoAndroid
path: demo/android/perlinWorld/app/release/*.aab
# - name: upload artifact
# uses: actions/upload-artifact@v3
# with:
# name: screenshot-android
# path: screenshot-android.png
release:
needs: [linuxXlinux, linuxXwindows, linuxXandroid]
if: github.ref_type == 'tag'
runs-on: ubuntu-20.04
steps:
- name: get linux build
uses: actions/download-artifact@v3
with:
name: linuxbuild
- name: get windows build
uses: actions/download-artifact@v3
with:
name: windowsbuild
- name: get android build
uses: actions/download-artifact@v3
with:
name: androidbuild
- name: create release
id: createRelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
release_name: "release-${{ github.ref_name }}"
tag_name: ${{ github.ref }}
- name: upload linux release artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: linuxbuild.zip
asset_name: linux
asset_content_type: application/zip
retention-days: 30
- name: upload windows release artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: windowsbuild.zip
asset_name: windows
asset_content_type: application/zip
retention-days: 30
- name: upload android release artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: androidbuild.zip
asset_name: android
asset_content_type: application/zip
retention-days: 30