Skip to content

Commit

Permalink
Update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Dec 26, 2024
1 parent e4ea967 commit 1c00090
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 34 deletions.
18 changes: 18 additions & 0 deletions .github/actions/web-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Setup Base Dependencies
description: Setup Emscripten
runs:
using: "composite"
steps:
- name: Set up Emscripten latest
uses: mymindstorm/setup-emsdk@v14
env:
EM_VERSION: 3.1.64
EM_CACHE_FOLDER: emsdk-cache
with:
version: ${{ env.EM_VERSION }}
actions-cache-folder: ${{ env.EM_CACHE_FOLDER }}
cache-key: emsdk-${{ matrix.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}

- name: Verify Emscripten setup
run: |
emcc -v
32 changes: 19 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
- identifier: linux
platform: linux
name: 🐧 Linux
runner: ubuntu-20.04
runner: ubuntu-latest
arch: x86_64

- identifier: windows
platform: windows
name: 🪟 Windows
runner: ubuntu-20.04
runner: ubuntu-latest
arch: x86_64

- identifier: macos
Expand All @@ -44,17 +44,17 @@ jobs:
runner: macos-latest
arch: universal

- identifier: android-arm64
- identifier: android
platform: android
name: 🤖 Android Arm64
runner: ubuntu-20.04
arch: arm64
name: 🤖 Android Arm
runner: ubuntu-latest
arch: [arm64, arm32]

- identifier: android-arm32
platform: android
name: 🤖 Android Arm32
runner: ubuntu-20.04
arch: arm32
- identifier: web
platform: web
name: 🌐 Web
runner: ubuntu-latest
threads: [yes, no]

steps:
- name: Checkout Terrain3D
Expand All @@ -73,6 +73,10 @@ jobs:
ndk-version: r23c
link-to-sdk: true

- name: Setup Web Dependencies
if: ${{ matrix.platform == 'web' }}
uses: ./.github/actions/web-deps

- name: Setup Base Dependencies
uses: ./.github/actions/base-deps

Expand All @@ -84,12 +88,14 @@ jobs:

- name: Build Terrain3D
env:
if: ${{ matrix.platform != 'web' }}
SCONS_CACHE: "${{ github.workspace }}/.scons-cache/"
TARGET: 'template_${{ matrix.target }}'
ARCH: '${{ matrix.arch }}'
ARCH: 'arch=${{ matrix.arch }}'
THREADS: 'threads=${{ matrix.threads }}'
shell: sh
run: |
scons target=$TARGET platform='${{ matrix.platform }}' arch=$ARCH debug_symbols=no -j2
scons target=$TARGET platform='${{ matrix.platform }}' $ARCH $THREADS debug_symbols=no -j2
- name: Strip Libraries (Windows/Linux)
if: ${{ matrix.platform == 'windows' || matrix.platform == 'linux' }}
Expand Down
30 changes: 13 additions & 17 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: 🌐 Web Builds
on: [ workflow_call, workflow_dispatch ]
on: [ push, workflow_call, workflow_dispatch ]

jobs:
build:
name: 🌐 Web ${{ matrix.arch }} ${{ matrix.target }}
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -14,32 +14,28 @@ jobs:
#threads: [yes, no]

steps:
- name: Set up Emscripten latest
uses: mymindstorm/setup-emsdk@v14
env:
EM_VERSION: 3.1.64
EM_CACHE_FOLDER: emsdk-cache
with:
version: ${{ env.EM_VERSION }}
actions-cache-folder: ${{ env.EM_CACHE_FOLDER }}
cache-key: emsdk-${{ matrix.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}

- name: Verify Emscripten setup
run: |
emcc -v
- name: Checkout Terrain3D
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Web Dependencies
if: ${{ matrix.platform == 'web' }}
uses: ./.github/actions/web-deps

- name: Setup Base Dependencies
uses: ./.github/actions/base-deps

# - name: Setup Build Cache
# uses: ./.github/actions/build-cache
# with:
# cache-name: ${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.threads }}
# continue-on-error: true

- name: Setup Build Cache
uses: ./.github/actions/build-cache
with:
cache-name: ${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.threads }}
cache-name: ${{ matrix.identifier }}-${{ matrix.target }}
continue-on-error: true

- name: Build Terrain3D
Expand Down
1 change: 1 addition & 0 deletions Terrain3D.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
<ItemGroup>
<None Include=".github\actions\base-deps\action.yml" />
<None Include=".github\actions\build-cache\action.yml" />
<None Include=".github\actions\web-deps\action.yml" />
<None Include=".github\actions\windows-deps\action.yml" />
<None Include=".github\ISSUE_TEMPLATE\bug_report.yml" />
<None Include=".github\ISSUE_TEMPLATE\config.yml" />
Expand Down
5 changes: 1 addition & 4 deletions doc/docs/platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ Further reading:

## WebGL

The Terrain3D library can be exported to WebGL, however the terrain will not currently render. It requires the [Compatibility Renderer (read more)](#compatibility), which is now supported, and but there are some additional shader elements that need to be sorted out before it will work.

Further reading:
* [Issue 502](https://github.com/TokisanGames/Terrain3D/issues/502)
Web Exports are very experimental. We have a working test environment. It requires [Compatibility Renderer (read more)](#compatibility). See the progress and setup in [Issue 502](https://github.com/TokisanGames/Terrain3D/issues/502).


Supported Renderers
Expand Down

0 comments on commit 1c00090

Please sign in to comment.