Skip to content

wsdws

wsdws #25

Workflow file for this run

# File: .github/workflows/unity-build.yml
name: Unity Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# ADD THIS DEBUGGING STEP
- name: 🤫 Check if Secret is Loaded
run: |
if [ -z "${{ secrets.UNITY_LICENSE }}" ]; then
echo "❌ ERROR: UNITY_LICENSE secret is NOT set or is empty!"
exit 1
else
echo "✅ SUCCESS: UNITY_LICENSE secret is loaded."
fi
# 1. Checkout the repository to the runner
- name: Checkout project
uses: actions/checkout@v4
# 2. Automatically get the Unity version from the project settings
- name: Get Unity Version
id: get-unity-version
run: |
version=$(grep "^m_EditorVersion:" ProjectSettings/ProjectVersion.txt | sed 's/m_EditorVersion: //')
echo "version=$version" >> $GITHUB_OUTPUT
# 3. Perform the build using GameCI's builder action
- name: Unity - Build
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: WebGL # Or your desired platform
# ... other options
# 4. (Optional) Upload the build artifact so you can download it
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
# Updated artifact name for the web build
name: build-WebGL
# Updated path to the WebGL build folder
path: build/WebGL