Some checks failed
Unreal Engine Build / trigger-builds (push) Has been cancelled
81 lines
2.9 KiB
YAML
81 lines
2.9 KiB
YAML
name: macOS Build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
macos-build:
|
|
runs-on: macos
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
lfs: true
|
|
fetch-depth: 0
|
|
|
|
- name: Setup environment
|
|
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
|
|
|
|
# Create directories for builds
|
|
mkdir -p Builds/Mac
|
|
mkdir -p PackagedReleases
|
|
|
|
echo "Using Unreal Engine 5.5"
|
|
|
|
- name: Build for macOS
|
|
run: |
|
|
chmod +x ./scripts/mac_build.sh
|
|
./scripts/mac_build.sh
|
|
|
|
- name: Package macOS build
|
|
run: |
|
|
echo "Preparing packaged files for release..."
|
|
|
|
# Find the app bundle in the Builds directory
|
|
APP_PATH=$(find Builds -type d -name "*.app" | head -1)
|
|
|
|
if [ -n "$APP_PATH" ]; then
|
|
echo "Found app bundle: $APP_PATH"
|
|
# Get the app name
|
|
APP_NAME=$(basename "$APP_PATH")
|
|
# Create zip file of the app bundle
|
|
(cd $(dirname "$APP_PATH") && zip -r "../../PackagedReleases/LuckyRobots-macOS.zip" "$APP_NAME")
|
|
echo "Created packaged release: PackagedReleases/LuckyRobots-macOS.zip"
|
|
else
|
|
echo "No .app bundle found in Builds directory"
|
|
|
|
# Look for a directory that might be a bundle but not named .app
|
|
MAIN_BUILD_DIR=$(find Builds -mindepth 1 -maxdepth 1 -type d | head -1)
|
|
if [ -n "$MAIN_BUILD_DIR" ]; then
|
|
echo "Found main build directory: $MAIN_BUILD_DIR"
|
|
DIR_NAME=$(basename "$MAIN_BUILD_DIR")
|
|
# Package this directory as if it were the app
|
|
(cd $(dirname "$MAIN_BUILD_DIR") && zip -r "../../PackagedReleases/LuckyRobots-macOS.zip" "$DIR_NAME")
|
|
echo "Created packaged release from main directory: PackagedReleases/LuckyRobots-macOS.zip"
|
|
else
|
|
# Package the entire Builds directory as a fallback
|
|
echo "No main directory found, packaging everything"
|
|
zip -r "PackagedReleases/LuckyRobots-macOS.zip" Builds
|
|
echo "Created fallback package: PackagedReleases/LuckyRobots-macOS.zip"
|
|
fi
|
|
fi
|
|
|
|
echo "Packaged releases:"
|
|
ls -la PackagedReleases/
|
|
|
|
- name: Upload macOS Build Artifact
|
|
uses: actions/upload-artifact@v3
|
|
if: success()
|
|
with:
|
|
name: LuckyRobots-macOS
|
|
path: PackagedReleases/LuckyRobots-macOS.zip
|
|
retention-days: 365 |