refactor(workflows): consolidate build steps into separate workflow files for Windows, Linux, and macOS
This commit is contained in:
parent
4d067474e3
commit
f804e441bb
@ -7,169 +7,13 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows-build:
|
windows-build:
|
||||||
runs-on: windows
|
uses: ./.gitea/workflows/windows-build.yml
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
lfs: true
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup environment
|
|
||||||
run: |
|
|
||||||
# Set environment variables for Unreal Engine
|
|
||||||
echo "UE_ROOT=E:/Games/UE_5.5" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# Create directories for builds
|
|
||||||
if (!(Test-Path "Builds/Windows")) { New-Item -ItemType Directory -Path "Builds/Windows" -Force }
|
|
||||||
if (!(Test-Path "PackagedReleases")) { New-Item -ItemType Directory -Path "PackagedReleases" -Force }
|
|
||||||
|
|
||||||
- name: Build for Windows
|
|
||||||
run: |
|
|
||||||
# Chmod command doesn't exist in Windows, use PowerShell to run the bash script
|
|
||||||
& 'C:\Program Files\Git\bin\bash.exe' -c "./scripts/win_build.sh"
|
|
||||||
|
|
||||||
- name: Package Windows build
|
|
||||||
run: |
|
|
||||||
echo "Packaging Windows build..."
|
|
||||||
if [ -d "Builds/Windows" ]; then
|
|
||||||
cd Builds/Windows
|
|
||||||
zip -r ../../PackagedReleases/LuckyRobots-Windows.zip .
|
|
||||||
cd ../..
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Packaged Windows release ==="
|
|
||||||
ls -la PackagedReleases/
|
|
||||||
|
|
||||||
- name: Upload Windows Build Artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
if: success() && hashFiles('PackagedReleases/LuckyRobots-Windows.zip') != ''
|
|
||||||
with:
|
|
||||||
name: LuckyRobots-Windows
|
|
||||||
path: PackagedReleases/LuckyRobots-Windows.zip
|
|
||||||
retention-days: 365
|
|
||||||
|
|
||||||
linux-build:
|
linux-build:
|
||||||
runs-on: windows
|
uses: ./.gitea/workflows/linux-build.yml
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
lfs: true
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup environment
|
|
||||||
run: |
|
|
||||||
# Set environment variables for Unreal Engine
|
|
||||||
echo "UE_ROOT=E:/Games/UE_5.5" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# Set environment variables for Linux toolchain (needed for cross-compilation)
|
|
||||||
$env:LINUX_MULTIARCH_ROOT="C:/UnrealToolchains/v23_clang-18.1.0-rockylinux8"
|
|
||||||
echo "LINUX_MULTIARCH_ROOT=${LINUX_MULTIARCH_ROOT}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# Create directories for builds
|
|
||||||
if (!(Test-Path "Builds/Linux")) { New-Item -ItemType Directory -Path "Builds/Linux" -Force }
|
|
||||||
if (!(Test-Path "PackagedReleases")) { New-Item -ItemType Directory -Path "PackagedReleases" -Force }
|
|
||||||
|
|
||||||
- name: Build for Linux
|
|
||||||
run: |
|
|
||||||
# Chmod command doesn't exist in Windows, use PowerShell to run the bash script
|
|
||||||
& 'C:\Program Files\Git\bin\bash.exe' -c "./scripts/linux_build.sh"
|
|
||||||
|
|
||||||
- name: Package Linux build
|
|
||||||
run: |
|
|
||||||
echo "Packaging Linux build..."
|
|
||||||
if [ -d "Builds/Linux" ]; then
|
|
||||||
cd Builds/Linux
|
|
||||||
zip -r ../../PackagedReleases/LuckyRobots-Linux.zip .
|
|
||||||
cd ../..
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Packaged Linux release ==="
|
|
||||||
ls -la PackagedReleases/
|
|
||||||
|
|
||||||
- name: Upload Linux Build Artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
if: success() && hashFiles('PackagedReleases/LuckyRobots-Linux.zip') != ''
|
|
||||||
with:
|
|
||||||
name: LuckyRobots-Linux
|
|
||||||
path: PackagedReleases/LuckyRobots-Linux.zip
|
|
||||||
retention-days: 365
|
|
||||||
|
|
||||||
macos-build:
|
macos-build:
|
||||||
runs-on: macos
|
uses: ./.gitea/workflows/macos-build.yml
|
||||||
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
|
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
needs: [windows-build, linux-build, macos-build]
|
needs: [windows-build, linux-build, macos-build]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user