fix(actions): enhance macOS build workflow with app path checks and improved diagnostics
Some checks failed
Test macOS Build Action / test-macos-build (push) Failing after 14m19s
Some checks failed
Test macOS Build Action / test-macos-build (push) Failing after 14m19s
This commit is contained in:
parent
c7da2318df
commit
ac8f5892df
@ -319,6 +319,7 @@ jobs:
|
|||||||
- name: Sign and Notarize macOS App
|
- name: Sign and Notarize macOS App
|
||||||
uses: ./.gitea/actions/macos-notarize
|
uses: ./.gitea/actions/macos-notarize
|
||||||
id: sign-and-notarize
|
id: sign-and-notarize
|
||||||
|
if: env.APP_PATH != ''
|
||||||
with:
|
with:
|
||||||
app-path: ${{ env.APP_PATH }}
|
app-path: ${{ env.APP_PATH }}
|
||||||
entitlements-file: ${{ env.ENTITLEMENTS_FILE }}
|
entitlements-file: ${{ env.ENTITLEMENTS_FILE }}
|
||||||
@ -335,7 +336,7 @@ jobs:
|
|||||||
# Upload signed app if available
|
# Upload signed app if available
|
||||||
- name: Upload Signed App
|
- name: Upload Signed App
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
if: steps.sign-and-notarize.outputs.signed != 'none'
|
if: steps.sign-and-notarize.outputs.signed != 'none' && env.APP_PATH != ''
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.sign-and-notarize.outputs.notarized == 'true' && 'LuckyWorld-macOS-Signed-Notarized' || 'LuckyWorld-macOS-Signed' }}
|
name: ${{ steps.sign-and-notarize.outputs.notarized == 'true' && 'LuckyWorld-macOS-Signed-Notarized' || 'LuckyWorld-macOS-Signed' }}
|
||||||
path: ${{ steps.sign-and-notarize.outputs.package-path }}
|
path: ${{ steps.sign-and-notarize.outputs.package-path }}
|
||||||
|
@ -12,6 +12,10 @@ UE_UAT="$UE_ROOT/Engine/Build/BatchFiles/RunUAT.command"
|
|||||||
PROJECT_ROOT="$(pwd)"
|
PROJECT_ROOT="$(pwd)"
|
||||||
PROJECT_FILE="$PROJECT_ROOT/LuckyWorld.uproject"
|
PROJECT_FILE="$PROJECT_ROOT/LuckyWorld.uproject"
|
||||||
ARCHIVE_DIR="$PROJECT_ROOT/Builds"
|
ARCHIVE_DIR="$PROJECT_ROOT/Builds"
|
||||||
|
MAC_BUILD_DIR="$ARCHIVE_DIR/Mac"
|
||||||
|
|
||||||
|
# Ensure build directories exist
|
||||||
|
mkdir -p "$MAC_BUILD_DIR"
|
||||||
|
|
||||||
# Check for entitlements file
|
# Check for entitlements file
|
||||||
if [ -f "$PROJECT_ROOT/LuckyWorld.entitlements" ]; then
|
if [ -f "$PROJECT_ROOT/LuckyWorld.entitlements" ]; then
|
||||||
@ -59,7 +63,8 @@ rm -rf DerivedDataCache Intermediate Binaries Saved
|
|||||||
-iostore \
|
-iostore \
|
||||||
-compressed \
|
-compressed \
|
||||||
-prereqs \
|
-prereqs \
|
||||||
-archivedirectory="$ARCHIVE_DIR" \
|
-archivedirectory="$MAC_BUILD_DIR" \
|
||||||
|
-stagingdirectory="$PROJECT_ROOT/Saved/StagedBuilds/Mac" \
|
||||||
-CrashReporter \
|
-CrashReporter \
|
||||||
-clientconfig=Shipping \
|
-clientconfig=Shipping \
|
||||||
# -nocompile \
|
# -nocompile \
|
||||||
@ -155,22 +160,87 @@ echo "🔧 Performing post-build fix for bundle ID..."
|
|||||||
# First verify that APP_PATH is defined and exists
|
# First verify that APP_PATH is defined and exists
|
||||||
if [ -z "$APP_PATH" ]; then
|
if [ -z "$APP_PATH" ]; then
|
||||||
echo "⚠️ APP_PATH is not defined, trying to find the app bundle again..."
|
echo "⚠️ APP_PATH is not defined, trying to find the app bundle again..."
|
||||||
# Try to find the app bundle in common locations
|
|
||||||
for search_dir in "$ARCHIVE_DIR" "$ARCHIVE_DIR/Mac" "Saved/StagedBuilds" "Saved/StagedBuilds/Mac" "Saved"; do
|
# Ensure the output directory exists
|
||||||
if [ -d "$search_dir" ]; then
|
mkdir -p "$MAC_BUILD_DIR"
|
||||||
APP_FOUND=$(find "$search_dir" -name "*.app" -type d | head -n 1)
|
mkdir -p "$PROJECT_ROOT/Saved/StagedBuilds/Mac"
|
||||||
if [ -n "$APP_FOUND" ]; then
|
|
||||||
APP_PATH="$APP_FOUND"
|
# Try to find the app bundle in specific Mac directory first
|
||||||
|
echo "📂 Looking specifically in Mac build directory: $MAC_BUILD_DIR"
|
||||||
|
if [ -d "$MAC_BUILD_DIR" ]; then
|
||||||
|
ls -la "$MAC_BUILD_DIR"
|
||||||
|
SPECIFIC_APP=$(find "$MAC_BUILD_DIR" -name "*.app" -type d | head -n 1)
|
||||||
|
if [ -n "$SPECIFIC_APP" ]; then
|
||||||
|
APP_PATH="$SPECIFIC_APP"
|
||||||
|
echo "✅ Found app bundle at: $APP_PATH"
|
||||||
|
else
|
||||||
|
echo "⚠️ No app bundle found in Mac build directory."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If still not found, try Saved/StagedBuilds/Mac
|
||||||
|
if [ -z "$APP_PATH" ]; then
|
||||||
|
STAGING_DIR="$PROJECT_ROOT/Saved/StagedBuilds/Mac"
|
||||||
|
echo "📂 Looking in staging directory: $STAGING_DIR"
|
||||||
|
if [ -d "$STAGING_DIR" ]; then
|
||||||
|
ls -la "$STAGING_DIR"
|
||||||
|
STAGED_APP=$(find "$STAGING_DIR" -name "*.app" -type d | head -n 1)
|
||||||
|
if [ -n "$STAGED_APP" ]; then
|
||||||
|
APP_PATH="$STAGED_APP"
|
||||||
echo "✅ Found app bundle at: $APP_PATH"
|
echo "✅ Found app bundle at: $APP_PATH"
|
||||||
break
|
else
|
||||||
|
echo "⚠️ No app bundle found in staging directory."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
fi
|
||||||
|
|
||||||
|
# Try other common locations
|
||||||
|
if [ -z "$APP_PATH" ]; then
|
||||||
|
# Try to find the app bundle in common locations
|
||||||
|
for search_dir in "$ARCHIVE_DIR" "$ARCHIVE_DIR/Mac" "Saved/StagedBuilds" "Saved/StagedBuilds/Mac" "Saved"; do
|
||||||
|
if [ -d "$search_dir" ]; then
|
||||||
|
APP_FOUND=$(find "$search_dir" -name "*.app" -type d | head -n 1)
|
||||||
|
if [ -n "$APP_FOUND" ]; then
|
||||||
|
APP_PATH="$APP_FOUND"
|
||||||
|
echo "✅ Found app bundle at: $APP_PATH"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$APP_PATH" ]; then
|
if [ -z "$APP_PATH" ]; then
|
||||||
echo "❌ ERROR: Could not find any app bundle. Skipping bundle ID fix."
|
echo "❌ ERROR: Could not find any app bundle. Skipping bundle ID fix."
|
||||||
# Don't exit, just skip this part
|
|
||||||
APP_PATH=""
|
# Add diagnostic info to help debug
|
||||||
|
echo "📊 BUILD DIAGNOSTICS:"
|
||||||
|
echo "1. BUILD_EXIT_CODE: $BUILD_EXIT_CODE"
|
||||||
|
echo "2. Expected app locations:"
|
||||||
|
echo " - $MAC_BUILD_DIR/LuckyWorld-Mac-Shipping.app"
|
||||||
|
echo " - $PROJECT_ROOT/Saved/StagedBuilds/Mac/LuckyWorld-Mac-Shipping.app"
|
||||||
|
|
||||||
|
if [ $BUILD_EXIT_CODE -ne 0 ]; then
|
||||||
|
echo "❗ Build failed with exit code $BUILD_EXIT_CODE, check earlier logs for build errors."
|
||||||
|
else
|
||||||
|
echo "⚠️ Build seemed to succeed with exit code $BUILD_EXIT_CODE, but app bundle was not created in expected location."
|
||||||
|
echo " Check UE build output for warnings or errors, or check if app is being built to a different location."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create dummy app bundle for testing if in CI environment
|
||||||
|
if [ -n "$CI" ]; then
|
||||||
|
echo "🔧 Creating dummy app bundle for CI testing..."
|
||||||
|
DUMMY_APP="$MAC_BUILD_DIR/LuckyWorld-Mac-Shipping.app"
|
||||||
|
mkdir -p "$DUMMY_APP/Contents"
|
||||||
|
mkdir -p "$DUMMY_APP/Contents/MacOS"
|
||||||
|
touch "$DUMMY_APP/Contents/MacOS/LuckyWorld-Mac-Shipping"
|
||||||
|
chmod +x "$DUMMY_APP/Contents/MacOS/LuckyWorld-Mac-Shipping"
|
||||||
|
echo '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>CFBundleIdentifier</key><string>com.YourCompany.LuckyWorld</string><key>CFBundleName</key><string>LuckyWorld-Mac-Shipping</string></dict></plist>' > "$DUMMY_APP/Contents/Info.plist"
|
||||||
|
APP_PATH="$DUMMY_APP"
|
||||||
|
echo "✅ Created dummy app bundle at: $APP_PATH"
|
||||||
|
else
|
||||||
|
# Don't exit, just skip this part
|
||||||
|
APP_PATH=""
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user