Skip to content

Commit 8f19e34

Browse files
committed
ci: fix Unity activation env handling for GameCI
1 parent f848a8f commit 8f19e34

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/webgl-pages.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,35 @@ jobs:
3232
with:
3333
lfs: true
3434

35+
- name: Validate Unity activation configuration
36+
env:
37+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
38+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
39+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
40+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
41+
UNITY_LICENSING_SERVER: ${{ secrets.UNITY_LICENSING_SERVER }}
42+
run: |
43+
if [ -n "$UNITY_LICENSING_SERVER" ]; then
44+
echo "Using UNITY_LICENSING_SERVER activation."
45+
exit 0
46+
fi
47+
48+
if [ -n "$UNITY_EMAIL" ] && [ -n "$UNITY_PASSWORD" ] && { [ -n "$UNITY_SERIAL" ] || [ -n "$UNITY_LICENSE" ]; }; then
49+
echo "Using credential-based Unity activation."
50+
exit 0
51+
fi
52+
53+
echo "::error::Invalid Unity activation config. Set UNITY_LICENSING_SERVER or set UNITY_EMAIL + UNITY_PASSWORD + (UNITY_SERIAL or UNITY_LICENSE) as repository secrets."
54+
exit 1
55+
3556
- name: Build WebGL project
3657
uses: game-ci/unity-builder@v4
3758
env:
38-
UNITY_EMAIL: ""
39-
UNITY_PASSWORD: ""
40-
UNITY_SERIAL: ""
59+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
60+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
61+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
4162
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
63+
UNITY_LICENSING_SERVER: ${{ secrets.UNITY_LICENSING_SERVER }}
4264
with:
4365
unityVersion: auto
4466
targetPlatform: WebGL

0 commit comments

Comments
 (0)