1- # File: .github/workflows/unity-build.yml
2-
1+ # A workflow to automatically build your Unity project
32name : Unity Build
43
4+ # Controls when the action will run
55on :
6+ # Triggers the workflow on push events for the "main" branch
67 push :
78 branches : [ "main" ]
9+
10+ # Triggers the workflow on pull requests targeting the "main" branch
811 pull_request :
912 branches : [ "main" ]
13+
14+ # Allows you to run this workflow manually from the Actions tab
1015 workflow_dispatch :
1116
1217jobs :
1318 build :
19+ # The type of runner that the job will run on
1420 runs-on : ubuntu-latest
1521
1622 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-
3223 # 1. Checkout the repository to the runner
3324 - name : Checkout project
3425 uses : actions/checkout@v4
@@ -44,19 +35,19 @@ jobs:
4435 - name : Unity - Build
4536 uses : game-ci/unity-builder@v4
4637 env :
47- UNITY_LICENSE : ${{ secrets.UNITY_LICENSE }}
38+ # Your Unity credentials for a fresh activation on the runner
39+ UNITY_EMAIL : ${{ secrets.UNITY_EMAIL }}
40+ UNITY_PASSWORD : ${{ secrets.UNITY_PASSWORD }}
4841 with :
49- targetPlatform : WebGL # Or your desired platform
50- # ... other options
42+ # The Unity version to use for the build
43+ unityVersion : ${{ steps.get-unity-version.outputs.version }}
44+
45+ # The platform to build for (WebGL for web builds)
46+ targetPlatform : WebGL
5147
5248 # 4. (Optional) Upload the build artifact so you can download it
5349 - name : Upload Build Artifact
5450 uses : actions/upload-artifact@v4
5551 with :
56- # Updated artifact name for the web build
5752 name : build-WebGL
58- # Updated path to the WebGL build folder
59- path : build/WebGL
60-
61-
62-
53+ path : build/WebGL
0 commit comments