WIP: Add web workflow #887
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 🛠️ Build All | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
paths: [ '**' ] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: ${{ matrix.name }} ${{ matrix.target }} | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
fail-fast: false | |
matrix: | |
identifier: [linux, windows, macos, ios, android] | |
target: [debug, release] | |
include: | |
- identifier: linux | |
platform: linux | |
name: 🐧 Linux | |
runner: ubuntu-22.04 | |
arch: x86_64 | |
- identifier: windows | |
platform: windows | |
name: 🪟 Windows | |
runner: ubuntu-22.04 | |
arch: x86_64 | |
- identifier: macos | |
platform: macos | |
name: 🍎 macOS | |
runner: macos-latest | |
arch: universal | |
- identifier: ios | |
platform: ios | |
name: 🍏 iOS | |
runner: macos-latest | |
arch: universal | |
- identifier: android | |
platform: android | |
name: 🤖 Android Arm | |
runner: ubuntu-24.04 | |
arch: [arm32, arm64] | |
steps: | |
- name: Checkout Terrain3D | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Windows Dependencies | |
if: ${{ matrix.platform == 'windows' }} | |
uses: ./.github/actions/windows-deps | |
- name: Setup Android Dependencies | |
if: ${{ matrix.platform == 'android' }} | |
uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: r23c | |
link-to-sdk: true | |
- name: Setup Base Dependencies | |
uses: ./.github/actions/base-deps | |
- name: Setup Build Cache | |
uses: ./.github/actions/build-cache | |
with: | |
cache-name: ${{ matrix.identifier }}-${{ matrix.target }} | |
continue-on-error: true | |
- name: Build Terrain3D | |
env: | |
SCONS_CACHE: "${{ github.workspace }}/.scons-cache/" | |
TARGET: 'template_${{ matrix.target }}' | |
ARCH: '${{ matrix.arch }}' | |
shell: sh | |
run: | | |
scons target=$TARGET platform='${{ matrix.platform }}' arch=$ARCH debug_symbols=no -j2 | |
- name: Strip Libraries (Windows/Linux) | |
if: ${{ matrix.platform == 'windows' || matrix.platform == 'linux' }} | |
shell: sh | |
run: | | |
ls -l project/addons/terrain_3d/bin/ | |
strip project/addons/terrain_3d/bin/libterrain.* | |
ls -l project/addons/terrain_3d/bin/ | |
- name: Include Files | |
shell: sh | |
run: | | |
cp '${{ github.workspace }}/README.md' '${{ github.workspace }}/LICENSE.txt' ${{ github.workspace }}/project/addons/terrain_3d/ | |
- name: Upload Package | |
uses: actions/upload-artifact@v4 | |
with: | |
include-hidden-files: true | |
name: t3d-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }} | |
path: | | |
${{ github.workspace }}/project/ | |
merge: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Merge Artifacts | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
include-hidden-files: true | |
name: ${{ github.event.repository.name }} | |
pattern: t3d-* | |
delete-merged: true |