From ea9c75143406506dad7830ede6dcf19f96634c23 Mon Sep 17 00:00:00 2001 From: Ozgur Ersoy Date: Tue, 15 Apr 2025 15:14:42 +0200 Subject: [PATCH] fix(actions): enhance macOS build workflow with additional app existence checks and error messaging --- .gitea/workflows/test-macos-build.yml | 12 ++++++++++++ Source/LuckyWorldEditor.Target.cs | 1 + scripts/mac_build.sh | 10 ++++++++++ 3 files changed, 23 insertions(+) diff --git a/.gitea/workflows/test-macos-build.yml b/.gitea/workflows/test-macos-build.yml index 7609692a..d97ed2e7 100644 --- a/.gitea/workflows/test-macos-build.yml +++ b/.gitea/workflows/test-macos-build.yml @@ -78,6 +78,18 @@ jobs: # Set CI environment variable explicitly before running export CI=true ./scripts/mac_build.sh + + # Check if the build succeeded by looking for the app + APP_PATHS=$(find ./Builds -type d -name "*.app" 2>/dev/null || echo "") + if [ -z "$APP_PATHS" ]; then + APP_PATHS=$(find ./Saved/StagedBuilds -type d -name "*.app" 2>/dev/null || echo "") + fi + + if [ -z "$APP_PATHS" ]; then + echo "❌ ERROR: Build command appeared to succeed but no app bundle was found!" + echo "This usually means the build failed but didn't properly return an error code." + exit 1 + fi else echo "ERROR: Build script not found at ./scripts/mac_build.sh" exit 1 diff --git a/Source/LuckyWorldEditor.Target.cs b/Source/LuckyWorldEditor.Target.cs index a698b47d..db543322 100644 --- a/Source/LuckyWorldEditor.Target.cs +++ b/Source/LuckyWorldEditor.Target.cs @@ -9,6 +9,7 @@ public class LuckyWorldEditorTarget : TargetRules { Type = TargetType.Editor; DefaultBuildSettings = BuildSettingsVersion.V5; + bOverrideBuildEnvironment = true; ExtraModuleNames.AddRange( new string[] { "LuckyWorld" } ); diff --git a/scripts/mac_build.sh b/scripts/mac_build.sh index a7bc439d..ee52fc1f 100755 --- a/scripts/mac_build.sh +++ b/scripts/mac_build.sh @@ -76,6 +76,16 @@ echo "🦾 Build completed. Application path:" APP_PATH=$(find "$ARCHIVE_DIR" -name "*.app" -type d | head -n 1) echo "$APP_PATH" +# Check if the build actually succeeded by verifying the app exists +if [ -z "$APP_PATH" ] || [ ! -d "$APP_PATH" ]; then + echo "❌ ERROR: Build failed or did not produce an app bundle!" + echo "Check the logs above for build errors." + echo "Common issues:" + echo " - 'Targets with a unique build environment cannot be built with an installed engine'" + echo " Fix: Use bOverrideBuildEnvironment = true instead of BuildEnvironment = TargetBuildEnvironment.Unique" + exit 1 +fi + if [ -n "$APP_PATH" ]; then echo "" echo "🔍 Binary files that will need signing:"