Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
oliexe authored Jun 20, 2024
1 parent 37e8da1 commit 050d4f3
Showing 1 changed file with 20 additions and 30 deletions.
50 changes: 20 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,38 @@
name: Test Build
name: Build project

on: [push, pull_request]

jobs:
build:
name: Test Package & Sample Scenes
buildForAllSupportedPlatforms:
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneWindows64 # Build a Windows 64-bit standalone.
- Android # Build an Android .apk standalone app.
- WebGL # WebGL.
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true

# Cache
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
# Build
- name: Build project (Desktop)
uses: game-ci/unity-builder@v4
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- if: matrix.targetPlatform == 'Android'
uses: jlumbroso/free-disk-space@v1.3.1
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneWindows64

# Build
- name: Build project (Mobile)
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: Android

# Output
targetPlatform: ${{ matrix.targetPlatform }}
- uses: actions/upload-artifact@v3
with:
name: Build
path: build
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}

0 comments on commit 050d4f3

Please sign in to comment.