Skip to content

Updating to SDK v57.0 #52

Updating to SDK v57.0

Updating to SDK v57.0 #52

Workflow file for this run

name: Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
OCULUS_VERSION: 57
GODOT_ENGINE_VERSION: "4.1.2"
GODOT_ENGINE_STAGE: "stable"
INTEGRATION_VERSION: "v1.3.1-beta"
jobs:
lint:
name: 🧹 Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check
uses: jidicula/[email protected]
with:
clang-format-version: '14'
check-path: 'src'
exclude-regex: 'include'
- name: Cancelling parallel jobs
if: ${{ failure() }}
uses: andymckay/[email protected]
build-all:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows
os: "windows-latest"
api-platform: windows
scons-platform: windows
artifact-name: windows
- name: macOS
os: "macos-11"
api-platform: mac
scons-platform: macos
artifact-name: macos
- name: Linux
os: "ubuntu-20.04"
api-platform: linux
scons-platform: linux
artifact-name: linux
- name: Android
os: "ubuntu-20.04"
api-platform: android
scons-platform: android
flags: arch=arm64v8
artifact-name: android-lib
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set godot-cpp commit hash env
shell: bash
run: |
cd godot-cpp
GODOT_CPP_COMMIT_HASH=$(git rev-parse HEAD)
echo "GODOT_CPP_COMMIT_HASH=$GODOT_CPP_COMMIT_HASH" >> $GITHUB_ENV
cd ..
- name: godot-cpp library cache
id: cache-godot-lib
uses: actions/cache@v3
env:
cache-name: cache-godot-lib
with:
path: godot-cpp/bin
key: ${{ matrix.api-platform }}-build-${{ env.cache-name }}-${{ env.GODOT_CPP_COMMIT_HASH }}
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: "3.x"
architecture: "x64"
- name: Set up dependencies (Python, SCons)
run: python -m pip install scons
- name: Compile Debug library
shell: bash
run: |
mkdir -p godot-cpp/bin
scons platform=${{ matrix.scons-platform }} target=template_debug generate_bindings=yes -j6 ${{ matrix.flags }} ${{ steps.cache-godot-lib.outputs.cache-hit == 'true' && 'build_library=no' || ''}}
- name: Compile Release library
shell: bash
run: |
scons platform=${{ matrix.scons-platform }} target=template_release generate_bindings=yes -j6 ${{ matrix.flags }} ${{ steps.cache-godot-lib.outputs.cache-hit == 'true' && 'build_library=no' || ''}}
- name: Upload generated addon libs
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
path: demo/addons/godot_oculus_platform
android-plugin:
runs-on: "ubuntu-20.04"
name: Android Plugin
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 11 for x64
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "adopt"
architecture: x64
- name: Change wrapper permissions
run: |
cd tools/godotoculusplatform-android-plugin/
chmod +x ./gradlew
cd ../../
- name: Build Android plugin
run: |
cd tools/godotoculusplatform-android-plugin/
./gradlew build
cd ../../
mkdir -p demo/android/plugins/godotoculusplatform
cp tools/godotoculusplatform-android-plugin/godotoculusplatform-android-plugin/build/outputs/aar/godotoculusplatform-android-plugin-release.aar demo/android/plugins/godotoculusplatform
- name: Upload Android Plugin
uses: actions/upload-artifact@v3
with:
name: android-plugin
path: demo/android
upload-addon:
runs-on: "ubuntu-20.04"
needs: [build-all, android-plugin]
name: Addon
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download all libs
uses: actions/download-artifact@v3
- name: Assemble all artifacts
run: |
ls
shopt -s dotglob
if [ ! -d "addons/godot_oculus_platform" ]; then
mkdir -p addons/godot_oculus_platform
cp ./LICENSE addons/godot_oculus_platform
fi
if [ -d windows ]; then
cp -r windows/* addons/godot_oculus_platform/
rm -r windows
fi
if [ -d macos ]; then
cp -r macos/* addons/godot_oculus_platform/
rm -r macos
fi
if [ -d linux ]; then
cp -r linux/* addons/godot_oculus_platform/
rm -r linux
fi
if [ -d android-lib ]; then
cp -r android-lib/* addons/godot_oculus_platform/
rm -r android-lib
fi
if [ ! -d "android/plugins/godotoculusplatform" ]; then
mkdir -p android/plugins/godotoculusplatform
fi
if [ -d android-plugin ]; then
mv android-plugin/plugins/godotoculusplatform/godotoculusplatform-android-plugin-release.aar android/plugins/godotoculusplatform/
rm -r android-plugin
cp demo/android/plugins/godotoculusplatform-android-plugin.gdap android/plugins
fi
- name: Clean up addon
run: |
rm -r ./godot-cpp
rm -r ./src
rm -r ./tools
rm -r ./demo
rm ./SConstruct
rm ./LICENSE
rm ./README.md
rm .gitignore
rm .gitmodules
rm .clang-format
rm -r ./.git
rm -r ./.github
- name: Upload final artifact
uses: actions/upload-artifact@v3
with:
name: GodotOculusPlatform-${{ env.INTEGRATION_VERSION }}_Godot-${{ env.GODOT_ENGINE_VERSION }}-${{ env.GODOT_ENGINE_STAGE }}_SDK-${{ env.OCULUS_VERSION }}
path: ./