name: Unreal Engine Build on: push: branches: [ main, develop ] pull_request: branches: [ main, develop ] jobs: # windows-build: # runs-on: windows # steps: # - name: Checkout repository # uses: actions/checkout@v3 # with: # lfs: true # fetch-depth: 0 # - name: Setup Unreal Engine # run: | # # Ensure Unreal Engine is installed and set up # # This assumes you have Unreal Engine installed on your runner # # If not, you can add installation steps here # # Set environment variables for Unreal Engine # echo "UE_ROOT=C:\Program Files\Epic Games\UE_5.2" >> $GITHUB_ENV # - name: Build Unreal Project # run: | # # Find your .uproject file (adjust path as needed) # $UPROJECT_PATH = Get-ChildItem -Path . -Filter "*.uproject" -Recurse | Select-Object -First 1 -ExpandProperty FullName # Write-Host "Building project: $UPROJECT_PATH" # # Use Unreal Automation Tool to build the project # & "$env:UE_ROOT\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun ` # -project="$UPROJECT_PATH" ` # -noP4 ` # -platform=Win64 ` # -clientconfig=Development ` # -cook -build -stage -pak -archive ` # -archivedirectory="$PWD\Build" # - name: Upload build artifacts # uses: actions/upload-artifact@v3 # with: # name: windows-build # path: Build/ # retention-days: 7 macos-build: runs-on: macos steps: - name: Checkout repository uses: actions/checkout@v3 with: lfs: true fetch-depth: 0 - name: Setup Unreal Engine run: | # Check if Unreal Engine is installed if [ ! -d "/Applications/Unreal Engine.app" ]; then echo "Error: Unreal Engine is not installed in the expected location" echo "Please ensure Unreal Engine is installed at /Applications/Unreal Engine.app" exit 1 fi # Set environment variables for Unreal Engine (with proper escaping) echo "UE_ROOT=/Applications/Unreal\ Engine.app/Contents/MacOS" >> $GITHUB_ENV echo "Using Unreal Engine 5.5.4" - name: Build Unreal Project run: | # Debug information echo "=== Environment Information ===" echo "macOS Version:" sw_vers echo "=== Unreal Engine Information ===" ls -la "/Applications/Unreal Engine.app/Contents/MacOS" echo "=== Project Information ===" # Source the environment source "$GITHUB_ENV" # Find your .uproject file (adjust path as needed) UPROJECT_PATH=$(find . -name "*.uproject" -type f | head -1) echo "Building project: $UPROJECT_PATH" # Verify UE_ROOT is correctly set echo "Using Unreal Engine at: $UE_ROOT" if [ ! -f "$UE_ROOT/Engine/Build/BatchFiles/RunUAT.sh" ]; then echo "Error: RunUAT.sh not found at $UE_ROOT/Engine/Build/BatchFiles/RunUAT.sh" echo "Please check UE_ROOT path" exit 1 fi # Use Unreal Automation Tool to build the project "$UE_ROOT/Engine/Build/BatchFiles/RunUAT.sh" BuildCookRun \ -project="$UPROJECT_PATH" \ -noP4 \ -platform=Mac \ -clientconfig=Development \ -cook -build -stage -pak -archive \ -archivedirectory="$PWD/Build" - name: Upload build artifacts uses: actions/upload-artifact@v3 with: name: macos-build path: Build/ retention-days: 7