Skip to content

Commit c78e4ca

Browse files
fgfg
1 parent 1094d35 commit c78e4ca

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

.github/workflows/unity-build.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# File: .github/workflows/unity-build.yml
2+
13
name: Unity Build
24

35
on:
@@ -10,33 +12,37 @@ on:
1012
jobs:
1113
build:
1214
runs-on: ubuntu-latest
15+
1316
steps:
14-
# 1. Checkout project
17+
# 1. Checkout the repository to the runner
1518
- name: Checkout project
16-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
1720

18-
# 2. Get Unity Version from ProjectSettings/ProjectVersion.txt
21+
# 2. Automatically get the Unity version from the project settings
1922
- name: Get Unity Version
2023
id: get-unity-version
2124
run: |
2225
version=$(grep "^m_EditorVersion:" ProjectSettings/ProjectVersion.txt | sed 's/m_EditorVersion: //')
2326
echo "version=$version" >> $GITHUB_OUTPUT
2427
25-
# 3. Build the project
26-
# This single step now handles activation and building
28+
# 3. Perform the build using GameCI's builder action
2729
- name: Unity - Build
2830
uses: game-ci/unity-builder@v4
2931
env:
32+
# The single secret containing your .ulf license file content
3033
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
31-
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
32-
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
3334
with:
35+
# The Unity version to use for the build
3436
unityVersion: ${{ steps.get-unity-version.outputs.version }}
35-
targetPlatform: Android # Or whatever platform you need
37+
38+
# The platform to build for is now WebGL
39+
targetPlatform: WebGL
3640

37-
# (Optional) 4. Upload build artifact
41+
# 4. (Optional) Upload the build artifact so you can download it
3842
- name: Upload Build Artifact
3943
uses: actions/upload-artifact@v4
4044
with:
41-
name: build-${{ steps.build.outputs.buildPath }}
42-
path: ${{ steps.build.outputs.buildPath }}
45+
# Updated artifact name for the web build
46+
name: build-WebGL
47+
# Updated path to the WebGL build folder
48+
path: build/WebGL

0 commit comments

Comments
 (0)