Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
LLarean committed Jul 22, 2024
1 parent 7c87244 commit 0c60a22
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,26 @@ on:
- main

jobs:
build:
buildForAllSupportedPlatforms:
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneWindows64 # Build a Windows 64-bit standalone.

steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v2
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-

- name: Set up Unity
uses: game-ci/unity-builder@v4
Expand All @@ -23,14 +37,9 @@ jobs:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: Android

- name: Build Unity project
run: |
unity -quit -batchmode -projectPath ./YourProjectPath -executeMethod BuildScript.PerformBuild
targetPlatform: targetPlatform: ${{ matrix.targetPlatform }}

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: build
path: ./YourProjectPath/Builds/
- uses: actions/upload-artifact@v2
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
16 changes: 9 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
name: Build Android
name: Build project

on: workflow_dispatch
on: [push, pull_request]

jobs:
buildForAllDesiredPlatforms:
buildForAllSupportedPlatforms:
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- Android # Build an Android .apk standalone app.

- WebGL # WebGL.
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v4
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- if: matrix.targetPlatform == 'Android'
uses: jlumbroso/[email protected]
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}

0 comments on commit 0c60a22

Please sign in to comment.