This commit is contained in:
parent
ae25a4607f
commit
fecfb77557
@ -7,48 +7,8 @@ on:
|
|||||||
branches: [ main, develop ]
|
branches: [ main, develop ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# windows-build:
|
windows-build:
|
||||||
# runs-on: windows
|
runs-on: windows
|
||||||
# steps:
|
|
||||||
# - name: Checkout repository
|
|
||||||
# uses: actions/checkout@v3
|
|
||||||
# with:
|
|
||||||
# lfs: true
|
|
||||||
# fetch-depth: 0 # Get all history to properly handle UE dependencies
|
|
||||||
|
|
||||||
# - 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:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -56,72 +16,150 @@ jobs:
|
|||||||
lfs: true
|
lfs: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Unreal Engine
|
- name: Set Unreal Engine Path
|
||||||
run: |
|
run: |
|
||||||
# Use the correct path where Unreal Engine is installed
|
echo "UE_ROOT=F:\LuckyRobots\LuckyRobots\Engine" >> $Env:GITHUB_ENV
|
||||||
UE_PATH="/Users/Shared/Epic Games/UE_5.5"
|
echo "DOTNET_CLI_HOME=$env:TEMP" >> $Env:GITHUB_ENV
|
||||||
|
echo "MSBUILDDISABLENODEREUSE=1" >> $Env:GITHUB_ENV
|
||||||
|
echo "DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1" >> $Env:GITHUB_ENV
|
||||||
|
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $Env:GITHUB_ENV
|
||||||
|
echo "DOTNET_BUILD_OUTPUT_DIR=$env:TEMP\dotnet-build" >> $Env:GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Set up build environment
|
||||||
|
run: |
|
||||||
|
# Create build directories with proper permissions
|
||||||
|
New-Item -ItemType Directory -Force -Path "$env:TEMP\dotnet-build"
|
||||||
|
icacls "$env:TEMP\dotnet-build" /grant Everyone:F
|
||||||
|
|
||||||
if [ ! -d "$UE_PATH" ]; then
|
# Set permissions on Engine directories
|
||||||
echo "Error: Unreal Engine is not installed in the expected location"
|
$engineDirs = @(
|
||||||
echo "Please ensure Unreal Engine is installed at $UE_PATH"
|
"$env:UE_ROOT\Source\Programs\Shared\EpicGames.Core",
|
||||||
exit 1
|
"$env:UE_ROOT\Source\Programs\Shared\EpicGames.OIDC",
|
||||||
fi
|
"$env:UE_ROOT\Source\Programs\Shared\EpicGames.Oodle",
|
||||||
|
"$env:UE_ROOT\Source\Programs\Shared\EpicGames.UBA"
|
||||||
|
)
|
||||||
|
|
||||||
# Set environment variable with the correct Engine path
|
foreach ($dir in $engineDirs) {
|
||||||
echo "UE_ROOT=$UE_PATH/Engine" >> $GITHUB_ENV
|
if (Test-Path $dir) {
|
||||||
echo "Using Unreal Engine 5.5"
|
icacls $dir /grant Everyone:F /T
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Clean .NET build cache
|
||||||
|
dotnet nuget locals all --clear
|
||||||
|
# Remove any existing build artifacts
|
||||||
|
Remove-Item -Path "$env:TEMP\dotnet-build\*" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
- name: Locate .uproject file
|
||||||
|
run: |
|
||||||
|
$UPROJECT_PATH = Get-ChildItem -Path "UNREAL_PROJECTS" -Filter "*.uproject" -Recurse | Select-Object -First 1 -ExpandProperty FullName
|
||||||
|
echo "UPROJECT_PATH=$UPROJECT_PATH" >> $Env:GITHUB_ENV
|
||||||
|
Write-Host "Found project file: $UPROJECT_PATH"
|
||||||
|
|
||||||
- name: Build Unreal Project
|
- name: Build Unreal Project
|
||||||
run: |
|
run: |
|
||||||
# Debug information
|
# Create and set permissions for build output directory
|
||||||
echo "=== Environment Information ==="
|
New-Item -ItemType Directory -Force -Path "$PWD\BuildOutput"
|
||||||
echo "macOS Version:"
|
icacls "$PWD\BuildOutput" /grant Everyone:F
|
||||||
sw_vers
|
|
||||||
echo "Current working directory: $(pwd)"
|
|
||||||
ls -la # List all files in current directory
|
|
||||||
|
|
||||||
echo "=== Unreal Engine Information ==="
|
# Run the build with elevated permissions
|
||||||
ls -la "$UE_ROOT/Build/BatchFiles"
|
$uatPath = Join-Path $Env:UE_ROOT "Build\BatchFiles\RunUAT.bat"
|
||||||
|
$arguments = "BuildCookRun -project=`"$Env:UPROJECT_PATH`" -noP4 -platform=Win64 -clientconfig=Development -cook -build -stage -pak -archive -archivedirectory=`"$PWD\BuildOutput`""
|
||||||
|
|
||||||
echo "=== Project Information ==="
|
# Use ProcessStartInfo for more control over the process
|
||||||
# Detailed search for the project file
|
$processInfo = New-Object System.Diagnostics.ProcessStartInfo
|
||||||
echo "Searching for .uproject files:"
|
$processInfo.FileName = $uatPath
|
||||||
find . -name "*.uproject" -type f
|
$processInfo.Arguments = $arguments
|
||||||
|
$processInfo.UseShellExecute = $true
|
||||||
|
$processInfo.Verb = "runas"
|
||||||
|
$processInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Normal
|
||||||
|
$processInfo.CreateNoWindow = $false
|
||||||
|
|
||||||
# Get the absolute path of the project file
|
$process = [System.Diagnostics.Process]::Start($processInfo)
|
||||||
UPROJECT_PATH=$(find . -name "*.uproject" -type f | head -1)
|
$process.WaitForExit()
|
||||||
if [ -z "$UPROJECT_PATH" ]; then
|
|
||||||
echo "Error: Could not find .uproject file"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Convert to absolute path and verify file exists
|
|
||||||
UPROJECT_ABSOLUTE_PATH=$(realpath "$UPROJECT_PATH")
|
|
||||||
echo "Project absolute path: $UPROJECT_ABSOLUTE_PATH"
|
|
||||||
|
|
||||||
if [ ! -f "$UPROJECT_ABSOLUTE_PATH" ]; then
|
|
||||||
echo "Error: Project file does not exist at: $UPROJECT_ABSOLUTE_PATH"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Using Unreal Engine at: $UE_ROOT"
|
|
||||||
|
|
||||||
# Make the project file readable and executable
|
|
||||||
chmod 755 "$UPROJECT_ABSOLUTE_PATH"
|
|
||||||
|
|
||||||
# Run the build using absolute paths
|
|
||||||
chmod +x "$UE_ROOT/Build/BatchFiles/RunUAT.sh"
|
|
||||||
"$UE_ROOT/Build/BatchFiles/RunUAT.sh" BuildCookRun \
|
|
||||||
-project="$UPROJECT_ABSOLUTE_PATH" \
|
|
||||||
-noP4 \
|
|
||||||
-platform=Mac \
|
|
||||||
-clientconfig=Development \
|
|
||||||
-cook -build -stage -pak -archive \
|
|
||||||
-archivedirectory="$(pwd)/Build"
|
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: macos-build
|
name: windows-build
|
||||||
path: Build/
|
path: BuildOutput/
|
||||||
retention-days: 7
|
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: |
|
||||||
|
# # Use the correct path where Unreal Engine is installed
|
||||||
|
# UE_PATH="/Users/Shared/Epic Games/UE_5.5"
|
||||||
|
|
||||||
|
# if [ ! -d "$UE_PATH" ]; then
|
||||||
|
# echo "Error: Unreal Engine is not installed in the expected location"
|
||||||
|
# echo "Please ensure Unreal Engine is installed at $UE_PATH"
|
||||||
|
# exit 1
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# # Set environment variable with the correct Engine path
|
||||||
|
# echo "UE_ROOT=$UE_PATH/Engine" >> $GITHUB_ENV
|
||||||
|
# echo "Using Unreal Engine 5.5"
|
||||||
|
|
||||||
|
# - name: Build Unreal Project
|
||||||
|
# run: |
|
||||||
|
# # Debug information
|
||||||
|
# echo "=== Environment Information ==="
|
||||||
|
# echo "macOS Version:"
|
||||||
|
# sw_vers
|
||||||
|
# echo "Current working directory: $(pwd)"
|
||||||
|
# ls -la # List all files in current directory
|
||||||
|
|
||||||
|
# echo "=== Unreal Engine Information ==="
|
||||||
|
# ls -la "$UE_ROOT/Build/BatchFiles"
|
||||||
|
|
||||||
|
# echo "=== Project Information ==="
|
||||||
|
# # Detailed search for the project file
|
||||||
|
# echo "Searching for .uproject files:"
|
||||||
|
# find . -name "*.uproject" -type f
|
||||||
|
|
||||||
|
# # Get the absolute path of the project file
|
||||||
|
# UPROJECT_PATH=$(find . -name "*.uproject" -type f | head -1)
|
||||||
|
# if [ -z "$UPROJECT_PATH" ]; then
|
||||||
|
# echo "Error: Could not find .uproject file"
|
||||||
|
# exit 1
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# # Convert to absolute path and verify file exists
|
||||||
|
# UPROJECT_ABSOLUTE_PATH=$(realpath "$UPROJECT_PATH")
|
||||||
|
# echo "Project absolute path: $UPROJECT_ABSOLUTE_PATH"
|
||||||
|
|
||||||
|
# if [ ! -f "$UPROJECT_ABSOLUTE_PATH" ]; then
|
||||||
|
# echo "Error: Project file does not exist at: $UPROJECT_ABSOLUTE_PATH"
|
||||||
|
# exit 1
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# echo "Using Unreal Engine at: $UE_ROOT"
|
||||||
|
|
||||||
|
# # Make the project file readable and executable
|
||||||
|
# chmod 755 "$UPROJECT_ABSOLUTE_PATH"
|
||||||
|
|
||||||
|
# # Run the build using absolute paths
|
||||||
|
# chmod +x "$UE_ROOT/Build/BatchFiles/RunUAT.sh"
|
||||||
|
# "$UE_ROOT/Build/BatchFiles/RunUAT.sh" BuildCookRun \
|
||||||
|
# -project="$UPROJECT_ABSOLUTE_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
|
Loading…
x
Reference in New Issue
Block a user