Skip to content

Commit 261fc59

Browse files
wsdws
1 parent 3fe905b commit 261fc59

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

.github/workflows/unity-build.yml

Lines changed: 32 additions & 5 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:
@@ -12,26 +14,51 @@ jobs:
1214
runs-on: ubuntu-latest
1315

1416
steps:
17+
18+
19+
20+
# ADD THIS DEBUGGING STEP
21+
- name: 🤫 Check if Secret is Loaded
22+
run: |
23+
if [ -z "${{ secrets.UNITY_LICENSE }}" ]; then
24+
echo "❌ ERROR: UNITY_LICENSE secret is NOT set or is empty!"
25+
exit 1
26+
else
27+
echo "✅ SUCCESS: UNITY_LICENSE secret is loaded."
28+
fi
29+
30+
31+
32+
# 1. Checkout the repository to the runner
1533
- name: Checkout project
1634
uses: actions/checkout@v4
1735

36+
37+
38+
# 2. Automatically get the Unity version from the project settings
1839
- name: Get Unity Version
1940
id: get-unity-version
2041
run: |
2142
version=$(grep "^m_EditorVersion:" ProjectSettings/ProjectVersion.txt | sed 's/m_EditorVersion: //')
2243
echo "version=$version" >> $GITHUB_OUTPUT
2344
45+
# 3. Perform the build using GameCI's builder action
2446
- name: Unity - Build
2547
uses: game-ci/unity-builder@v4
2648
env:
27-
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
28-
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
49+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
2950
with:
30-
unityVersion: ${{ steps.get-unity-version.outputs.version }}
31-
targetPlatform: WebGL
51+
targetPlatform: WebGL # Or your desired platform
52+
# ... other options
3253

54+
# 4. (Optional) Upload the build artifact so you can download it
3355
- name: Upload Build Artifact
3456
uses: actions/upload-artifact@v4
3557
with:
58+
# Updated artifact name for the web build
3659
name: build-WebGL
37-
path: build/WebGL
60+
# Updated path to the WebGL build folder
61+
path: build/WebGL
62+
63+
64+

0 commit comments

Comments
 (0)