Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: webgl ci #92

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,46 @@ jobs:
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneLinux64
buildMethod: Editor.Builder.BuildPackage

build-webgl:
name: Build WebGL
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true

# Git LFS
- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

- name: Restore LFS cache
uses: actions/cache@v3
id: lfs-cache
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

- name: Git LFS Pull
run: |
git lfs pull
git add .
git reset --hard
# Unity Cache
- uses: actions/cache@v3
with:
path: Library
key: Library-WebGL-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-WebGL-
# Build
- name: Build Unity WebGL
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: WebGL
buildMethod: Editor.Builder.BuildPackage
1 change: 1 addition & 0 deletions Assets/Dojo/Runtime/WorldManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class WorldManager : MonoBehaviour
async void Awake()
{
#if UNITY_WEBGL && !UNITY_EDITOR
break
wasmClient = new ToriiWasmClient(dojoConfig.toriiUrl, dojoConfig.relayWebrtcUrl, dojoConfig.worldAddress);
await wasmClient.CreateClient();
#else
Expand Down