61 lines
1.5 KiB
YAML
61 lines
1.5 KiB
YAML
name: Unity Build (Windows + WebGL)
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'unity-client/**'
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- 'unity-client/**'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
UNITY_PROJECT_PATH: unity-client
|
|
|
|
jobs:
|
|
build:
|
|
name: Build ${{ matrix.targetPlatform }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
targetPlatform:
|
|
- StandaloneWindows64
|
|
- WebGL
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Cache Unity Library
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.UNITY_PROJECT_PATH }}/Library
|
|
key: Library-${{ matrix.targetPlatform }}-${{ hashFiles(format('{0}/Assets/**', env.UNITY_PROJECT_PATH)) }}
|
|
restore-keys: |
|
|
Library-${{ matrix.targetPlatform }}-
|
|
Library-
|
|
|
|
- name: Build Unity project
|
|
uses: game-ci/unity-builder@v4
|
|
env:
|
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
|
with:
|
|
projectPath: ${{ env.UNITY_PROJECT_PATH }}
|
|
targetPlatform: ${{ matrix.targetPlatform }}
|
|
buildName: CommanderAILab
|
|
versioning: Semantic
|
|
|
|
- name: Upload build artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Build-${{ matrix.targetPlatform }}
|
|
path: build/${{ matrix.targetPlatform }}
|
|
retention-days: 14
|