Skip to content

Commit bbbb5ad

Browse files
authored
Update main.yml
1 parent d30f431 commit bbbb5ad

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,44 @@ jobs:
9494
name: Build-Windows
9595
path: build/StandaloneWindows64
9696

97+
build_webgl:
98+
name: Build WebGL
99+
runs-on: ubuntu-latest
100+
steps:
101+
# 1. Checkout
102+
- name: Checkout repository
103+
uses: actions/checkout@v4
104+
with:
105+
lfs: true
106+
fetch-depth: 0
107+
108+
# 2. Cache:缓存 team_project/Library
109+
- uses: actions/cache@v3
110+
id: cache-library-build
111+
with:
112+
path: team_project/Library
113+
key: Library-build-${{ hashFiles('team_project/Assets/**', 'team_project/Packages/**', 'team_project/ProjectSettings/**') }}
114+
restore-keys: |
115+
Library-build-
116+
117+
# 3. Build project(WebGL 平台)
118+
- name: Build project
119+
uses: game-ci/unity-builder@v4
120+
env:
121+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
122+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
123+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
124+
with:
125+
projectPath: team_project
126+
targetPlatform: WebGL
127+
128+
# 4. Upload artifact:指向 WebGL 的构建输出目录
129+
- name: Upload Build-WebGL
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: Build-WebGL
133+
path: build/WebGL
134+
97135
docs:
98136
name: Generate and Deploy Documentation
99137
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)