fix(actions): add error handling and suggestions for build issues in macOS workflow

This commit is contained in:
Ozgur 2025-04-15 14:28:10 +02:00
parent 63ca0d4883
commit 146dea5121
No known key found for this signature in database
GPG Key ID: 66CDF27505A35546
3 changed files with 43 additions and 7 deletions

View File

@ -100,24 +100,57 @@ jobs:
# Find the app bundle # Find the app bundle
- name: Find app bundle - name: Find app bundle
run: | run: |
# Add error handling
set +e # Don't exit immediately on error for this block
echo "Build status check..."
if [ ! -d "./Builds" ] && [ ! -d "./Saved/StagedBuilds" ]; then
echo "❌ ERROR: Build directories do not exist. Build likely failed."
echo "Checking build logs for common issues..."
# Check for the specific GlobalDefinitions error
if grep -q "GlobalDefinitions.*This is not allowed" "$GITHUB_WORKSPACE"/*.log 2>/dev/null || grep -q "BuildEnvironment = TargetBuildEnvironment.Unique" "$GITHUB_WORKSPACE"/*.log 2>/dev/null; then
echo "🔍 Found issue with GlobalDefinitions in build target."
echo "⚠️ Fix required in LuckyWorld.Target.cs - need to add BuildEnvironment = TargetBuildEnvironment.Unique;"
cat << 'EOF'
Fix suggestion for LuckyWorld.Target.cs:
Add this line in the constructor:
BuildEnvironment = TargetBuildEnvironment.Unique;
Example:
public LuckyWorldTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.V5;
BuildEnvironment = TargetBuildEnvironment.Unique; // Add this line
// Rest of your constructor...
}
EOF
fi
exit 1
fi
# First check Saved/StagedBuilds directory - where Unreal often places built apps # First check Saved/StagedBuilds directory - where Unreal often places built apps
echo "Checking Saved/StagedBuilds directory..." echo "Checking Saved/StagedBuilds directory..."
APP_PATHS=$(find ./Saved/StagedBuilds -type d -name "*.app" 2>/dev/null) APP_PATHS=$(find ./Saved/StagedBuilds -type d -name "*.app" 2>/dev/null || echo "")
# If not found, check Builds directory # If not found, check Builds directory
if [ -z "$APP_PATHS" ]; then if [ -z "$APP_PATHS" ]; then
echo "Checking Builds directory..." echo "No app found in Saved/StagedBuilds, checking Builds directory..."
APP_PATHS=$(find ./Builds -type d -name "*.app" 2>/dev/null) APP_PATHS=$(find ./Builds -type d -name "*.app" 2>/dev/null || echo "")
fi fi
# If still not found, check the whole workspace # If still not found, check the whole workspace
if [ -z "$APP_PATHS" ]; then if [ -z "$APP_PATHS" ]; then
echo "Checking entire workspace..." echo "No app found in Builds, checking entire workspace..."
APP_PATHS=$(find . -type d -name "*.app" -not -path "*/\.*" 2>/dev/null) APP_PATHS=$(find . -type d -name "*.app" -not -path "*/\.*" 2>/dev/null || echo "")
fi fi
if [ -z "$APP_PATHS" ]; then if [ -z "$APP_PATHS" ]; then
echo "ERROR: Could not find any app bundles!" echo "ERROR: Could not find any app bundles!"
echo "Listing all directories to help debug:" echo "Listing all directories to help debug:"
find . -type d -maxdepth 3 | sort find . -type d -maxdepth 3 | sort
exit 1 exit 1
@ -134,7 +167,7 @@ jobs:
# Make sure app exists - using local variable # Make sure app exists - using local variable
if [ ! -d "$MAIN_APP_PATH" ]; then if [ ! -d "$MAIN_APP_PATH" ]; then
echo "ERROR: App bundle not found at $MAIN_APP_PATH!" echo "ERROR: App bundle not found at $MAIN_APP_PATH!"
exit 1 exit 1
fi fi

View File

@ -9,6 +9,7 @@ public class LuckyWorldTarget : TargetRules
{ {
Type = TargetType.Game; Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.V5; DefaultBuildSettings = BuildSettingsVersion.V5;
BuildEnvironment = TargetBuildEnvironment.Unique;
ExtraModuleNames.AddRange( new string[] { "LuckyWorld" } ); ExtraModuleNames.AddRange( new string[] { "LuckyWorld" } );

View File

@ -135,3 +135,5 @@ if [ -n "$APP_PATH" ]; then
echo "⚠️ Info.plist not found at $INFO_PLIST" echo "⚠️ Info.plist not found at $INFO_PLIST"
fi fi
fi fi
echo "Completed post-build process ✅"