fix(actions): add error handling and suggestions for build issues in macOS workflow
This commit is contained in:
parent
63ca0d4883
commit
146dea5121
@ -100,24 +100,57 @@ jobs:
|
||||
# Find the app bundle
|
||||
- name: Find app bundle
|
||||
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
|
||||
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 [ -z "$APP_PATHS" ]; then
|
||||
echo "Checking Builds directory..."
|
||||
APP_PATHS=$(find ./Builds -type d -name "*.app" 2>/dev/null)
|
||||
echo "No app found in Saved/StagedBuilds, checking Builds directory..."
|
||||
APP_PATHS=$(find ./Builds -type d -name "*.app" 2>/dev/null || echo "")
|
||||
fi
|
||||
|
||||
# If still not found, check the whole workspace
|
||||
if [ -z "$APP_PATHS" ]; then
|
||||
echo "Checking entire workspace..."
|
||||
APP_PATHS=$(find . -type d -name "*.app" -not -path "*/\.*" 2>/dev/null)
|
||||
echo "No app found in Builds, checking entire workspace..."
|
||||
APP_PATHS=$(find . -type d -name "*.app" -not -path "*/\.*" 2>/dev/null || echo "")
|
||||
fi
|
||||
|
||||
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:"
|
||||
find . -type d -maxdepth 3 | sort
|
||||
exit 1
|
||||
@ -134,7 +167,7 @@ jobs:
|
||||
|
||||
# Make sure app exists - using local variable
|
||||
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
|
||||
fi
|
||||
|
||||
|
@ -9,6 +9,7 @@ public class LuckyWorldTarget : TargetRules
|
||||
{
|
||||
Type = TargetType.Game;
|
||||
DefaultBuildSettings = BuildSettingsVersion.V5;
|
||||
BuildEnvironment = TargetBuildEnvironment.Unique;
|
||||
|
||||
ExtraModuleNames.AddRange( new string[] { "LuckyWorld" } );
|
||||
|
||||
|
@ -135,3 +135,5 @@ if [ -n "$APP_PATH" ]; then
|
||||
echo "⚠️ Info.plist not found at $INFO_PLIST"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Completed post-build process ✅"
|
||||
|
Loading…
x
Reference in New Issue
Block a user