Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
forgrabbit authored Feb 2, 2025
1 parent 2af3b35 commit 9a7cc22
Showing 1 changed file with 19 additions and 47 deletions.
66 changes: 19 additions & 47 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,33 @@ on:
workflow_dispatch:

jobs:
activate-license:
client-unity-build:
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
outputs:
license-file: ${{ steps.export-license.outputs.licensePath }}
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneLinux64
- StandaloneOSX
- StandaloneWindows64
steps:
- name: Activate Unity License
uses: game-ci/unity-request-activation-file@v2
id: activation
- uses: actions/checkout@v4

- uses: game-ci/unity-builder@v4
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}

- name: Export License
id: export-license
run: |
mkdir -p ~/.unity3d
cp "$UNITY_LICENSE_FILE" ~/.unity3d/Unity_lic.ulf
mkdir -p ./license
license_path="./license/Unity_lic.ulf"
cp "$UNITY_LICENSE_FILE" "$license_path"
echo "licensePath=$license_path" >> $GITHUB_OUTPUT
env:
UNITY_LICENSE_FILE: ${{ steps.activation.outputs.licensePath }}

- name: Upload License Artifact
uses: actions/upload-artifact@v3
with:
name: unity-license
path: ${{ steps.export-license.outputs.licensePath }}

client-unity-build:
needs: activate-license
runs-on: ubuntu-latest
steps:
- name: Download License Artifact
if: github.event.pull_request.head.repo.full_name == github.repository
uses: actions/download-artifact@v3
with:
name: unity-license
path: ./license

- name: Setup License
if: github.event.pull_request.head.repo.full_name == github.repository
run: |
mkdir -p ~/.unity3d
cp ./license/Unity_lic.ulf ~/.unity3d/
- name: Build Project
if: github.event.pull_request.head.repo.full_name == github.repository
uses: game-ci/unity-builder@v4
with:
projectPath: client/unity
targetPlatform: ${{ matrix.targetPlatform }}
env:
UNITY_LICENSE: ~/.unity3d/Unity_lic.ulf
unityVersion: 2022.3.9f1

- uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-client-unity-${{ matrix.targetPlatform }}-${{ github.sha }}
path: build/${{ matrix.targetPlatform }}

client-unity-test:
if: ${{ github.event_name != 'pull_request' }}
Expand Down

0 comments on commit 9a7cc22

Please sign in to comment.