Update .gitea/workflows/build.yml
This commit is contained in:
parent
35a5c8b2a8
commit
39af8b3da5
@ -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:
|
||||
buildForAllSupportedPlatforms:
|
||||
buildAndTestForLinuxBasedPlatforms:
|
||||
name: Build for ${{ matrix.targetPlatform }}
|
||||
# runs-on: ubuntu-22.04-large
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
unityVersion:
|
||||
- 6000.0.37f1
|
||||
targetPlatform:
|
||||
- StandaloneWindows64 # Windows 64-bit standalone
|
||||
- StandaloneLinux64 # Linux 64-bit standalone
|
||||
unityVersion:
|
||||
- 6000.0.37f1 # Stable Unity LTS version (update if needed)
|
||||
|
||||
steps:
|
||||
- name: Update APT and Install Dependencies
|
||||
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
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
|
||||
- name: Add Current User to Docker Group
|
||||
run: |
|
||||
sudo usermod -aG docker $(whoami)
|
||||
sudo systemctl restart docker
|
||||
|
||||
|
||||
- name: Cache Unity Library (Speeds up builds)
|
||||
uses: actions/cache@v3
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.targetPlatform }}
|
||||
restore-keys: Library-
|
||||
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
|
||||
restore-keys: |
|
||||
Library-
|
||||
|
||||
- name: Ensure Entrypoint Exists & is Executable
|
||||
run: |
|
||||
if [ -f "/entrypoint.sh" ]; then
|
||||
echo "Entrypoint found!"
|
||||
chmod +x /entrypoint.sh
|
||||
else
|
||||
echo "Entrypoint script missing! Build may fail."
|
||||
fi
|
||||
# - uses: https://github.com/game-ci/unity-test-runner@v4
|
||||
# id: testRunner
|
||||
# env:
|
||||
# UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
# UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
# UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
# with:
|
||||
# unityVersion: ${{ matrix.unityVersion }}
|
||||
# githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build with Unity
|
||||
uses: game-ci/unity-builder@v4
|
||||
# - uses: actions/upload-artifact@v3
|
||||
# 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:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||
DOCKER_DEFAULT_PLATFORM: linux/amd64
|
||||
with:
|
||||
targetPlatform: ${{ matrix.targetPlatform }}
|
||||
# runAsHostUser: true
|
||||
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@v3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Build-${{ matrix.targetPlatform }}
|
||||
path: build/${{ matrix.targetPlatform }}
|
||||
name: Build
|
||||
path: build
|
Loading…
Reference in New Issue
Block a user