Update .gitea/workflows/build.yml

This commit is contained in:
EthanPisani 2025-02-19 01:02:29 -05:00
parent 35a5c8b2a8
commit 39af8b3da5

View File

@ -1,74 +1,69 @@
name: Build project # https://game.ci/docs/github/getting-started
name: Build Actions
on: [push, pull_request] on:
pull_request:
branches: [ main,activity4 ]
workflow_dispatch:
jobs: jobs:
buildForAllSupportedPlatforms: buildAndTestForLinuxBasedPlatforms:
name: Build for ${{ matrix.targetPlatform }} name: Build for ${{ matrix.targetPlatform }}
# runs-on: ubuntu-22.04-large
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
unityVersion:
- 6000.0.37f1
targetPlatform: targetPlatform:
- StandaloneWindows64 # Windows 64-bit standalone - StandaloneWindows64 # Windows 64-bit standalone
- StandaloneLinux64 # Linux 64-bit standalone - StandaloneLinux64 # Linux 64-bit standalone
unityVersion:
- 6000.0.37f1 # Stable Unity LTS version (update if needed)
steps: steps:
- name: Update APT and Install Dependencies - uses: actions/checkout@v4
run: |
sudo apt-get update
sudo apt-get install -y curl git-lfs
git lfs install
- name: Install Node.js
run: |
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
sudo apt-get install -y nodejs
node -v
- name: Checkout Repository
uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
lfs: true lfs: true
- name: Add Current User to Docker Group - uses: actions/cache@v4
run: |
sudo usermod -aG docker $(whoami)
sudo systemctl restart docker
- name: Cache Unity Library (Speeds up builds)
uses: actions/cache@v3
with: with:
path: Library path: Library
key: Library-${{ matrix.targetPlatform }} key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: Library- restore-keys: |
Library-
- name: Ensure Entrypoint Exists & is Executable # - uses: https://github.com/game-ci/unity-test-runner@v4
run: | # id: testRunner
if [ -f "/entrypoint.sh" ]; then # env:
echo "Entrypoint found!" # UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
chmod +x /entrypoint.sh # UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
else # UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
echo "Entrypoint script missing! Build may fail." # with:
fi # unityVersion: ${{ matrix.unityVersion }}
# githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Build with Unity # - uses: actions/upload-artifact@v3
uses: game-ci/unity-builder@v4 # if: always()
# with:
# name: Test results (all modes)
# path: ${{ steps.testRunner.outputs.artifactsPath }}
# - if: matrix.targetPlatform == 'Android'
# uses: jlumbroso/free-disk-space@v1.2.0
- uses: https://github.com/game-ci/unity-builder@v4
env: env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
DOCKER_DEFAULT_PLATFORM: linux/amd64
with: with:
targetPlatform: ${{ matrix.targetPlatform }} # runAsHostUser: true
unityVersion: ${{ matrix.unityVersion }} unityVersion: ${{ matrix.unityVersion }}
runAsHostUser: false # Fixes self-hosted permission issues targetPlatform: ${{ matrix.targetPlatform }}
# customParameters: '-myParameter myValue -myBoolean -ThirdParameter andItsValue'
- name: Upload Build Artifacts - uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with: with:
name: Build-${{ matrix.targetPlatform }} name: Build
path: build/${{ matrix.targetPlatform }} path: build