From 050d4f39c8fd7d08dc106ec9c97861f4b728898b Mon Sep 17 00:00:00 2001 From: Ondrej Rehacek Date: Thu, 20 Jun 2024 16:12:46 +0200 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 50 +++++++++++++++----------------------- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b07bf31..32143fa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 }}