Add workflow
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
name: Build Unity Game (Win / Linux / Mac)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-unity:
|
||||
runs-on: linux-mint
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- platform: windows
|
||||
build_target: Win64
|
||||
output_file: Game-Windows.exe
|
||||
- platform: linux
|
||||
build_target: Linux64
|
||||
output_file: Game-Linux.x86_64
|
||||
- platform: macos
|
||||
build_target: OSXUniversal
|
||||
output_file: Game-macOS.app
|
||||
env:
|
||||
UNITY_EDITOR_PATH: "/home/stefan-uni/Unity/Hub/Editor/6000.6.8f1/Editor/Unity"
|
||||
steps:
|
||||
- name: Checkout Unity Repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build Unity Player (${{ matrix.platform }})
|
||||
run: |
|
||||
set -e
|
||||
BUILD_DIR="Builds/${{ matrix.platform }}"
|
||||
mkdir -p "$BUILD_DIR"
|
||||
|
||||
"$UNITY_EDITOR_PATH" \
|
||||
-batchmode \
|
||||
-nographics \
|
||||
-quit \
|
||||
-projectPath "$(pwd)" \
|
||||
-buildTarget "${{ matrix.build_target }}" \
|
||||
-customBuildPath "$BUILD_DIR/${{ matrix.output_file }}" \
|
||||
-logFile "Builds/unity-${{ matrix.platform }}.log"
|
||||
|
||||
- name: Fix macOS Executable Permissions
|
||||
if: matrix.platform == 'macos'
|
||||
run: |
|
||||
chmod -R +x "Builds/macos/${{ matrix.output_file }}/Contents/MacOS" || true
|
||||
|
||||
- name: Upload Build Artifact (${{ matrix.platform }})
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-${{ matrix.platform }}
|
||||
path: Builds/${{ matrix.platform }}/**
|
||||
Reference in New Issue
Block a user