Skip to content

Commit

Permalink
Add web workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Dec 26, 2024
1 parent 2f58b73 commit a3d6bf5
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 1 deletion.
77 changes: 77 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: 🌐 Web Builds
on: [ workflow_call, workflow_dispatch ]

jobs:
build:
name: 🌐 Web ${{ matrix.arch }} ${{ matrix.target }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
platform: [web]
target: [debug, release]
threads: [no]
#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 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: Build Terrain3D
env:
SCONS_CACHE: "${{ github.workspace }}/.scons-cache/"
TARGET: 'template_${{ matrix.target }}'
shell: sh
run: |
scons target=$TARGET platform='${{ matrix.platform }}' threads='${{ matrix.threads }}' debug_symbols=no -j2
- name: Prepare Files
shell: sh
run: |
ls -l project/addons/terrain_3d/bin/
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.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
1 change: 1 addition & 0 deletions Terrain3D.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
<None Include=".github\workflows\ios.yml" />
<None Include=".github\workflows\linux.yml" />
<None Include=".github\workflows\macos.yml" />
<None Include=".github\workflows\web.yml" />
<None Include=".github\workflows\windows.yml" />
<None Include=".gitignore" />
<None Include="AUTHORS.md" />
Expand Down
3 changes: 3 additions & 0 deletions Terrain3D.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@
<None Include="doc\docs\introduction.md">
<Filter>2. Docs</Filter>
</None>
<None Include=".github\workflows\web.yml">
<Filter>1. Project Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Text Include=".readthedocs.yaml">
Expand Down
5 changes: 4 additions & 1 deletion project/addons/terrain_3d/terrain.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ android.debug.arm64 = "res://addons/terrain_3d/bin/libterrain.android.debug.arm6
android.release.arm64 = "res://addons/terrain_3d/bin/libterrain.android.release.arm64.so"

ios.debug = "res://addons/terrain_3d/bin/libterrain.ios.debug.universal.dylib"
ios.release = "res://addons/terrain_3d/bin/libterrain.ios.release.universal.dylib"
ios.release = "res://addons/terrain_3d/bin/libterrain.ios.release.universal.dylib"

web.debug = "res://addons/terrain_3d/bin/libterrain.web.debug.wasm32.wasm"
web.release = "res://addons/terrain_3d/bin/libterrain.web.release.wasm32.wasm"

0 comments on commit a3d6bf5

Please sign in to comment.