Build Game #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Secrets ##### | |
# Requires "TOKEN" to be defined with an access token from a github account that has access to the UnrealEngine source code | |
#### Runner requirements #### | |
## macOS ## | |
# 1. A valid Xcode environment with macOS and iOS SDKs | |
## Windows/Android/Linux ## | |
# 1. Visual Studio 2022 | |
# 2. Android NDK setup: https://docs.unrealengine.com/5.3/en-US/how-to-set-up-android-sdk-and-ndk-for-your-unreal-engine-development-environment/ | |
# 3. Linux cross-compile toolchain: https://docs.unrealengine.com/5.3/en-US/linux-development-requirements-for-unreal-engine/ ; We could use another linux runner, but it'll save quite a bit of time to just cross compile to linux instead of having to build yet-another UE build | |
name: Build Game | |
on: | |
workflow_dispatch: | |
inputs: | |
ENGINE_VERSION: | |
type: string | |
description: Unreal Engine Release Version | |
default: "5.3.2" | |
BUILD_MAC: | |
type: boolean | |
description: Build macOS | |
default: false | |
BUILD_IOS: | |
type: boolean | |
description: Build iOS | |
default: false | |
BUILD_WINDOWS: | |
type: boolean | |
description: Build Windows | |
default: true | |
BUILD_ANDROID: | |
type: boolean | |
description: Build Android | |
default: false | |
push: | |
tags: | |
- "*" | |
jobs: | |
build-game-apple: | |
runs-on: macOS | |
if: inputs.BUILD_MAC == true || inputs.BUILD_IOS == true | |
steps: | |
- name: setup | |
run: | | |
brew install p7zip | |
- uses: actions/checkout@v3 | |
with: | |
clean: true | |
lfs: true | |
path: "RiveGame" | |
- name: init and pull lfs because checkout doesnt | |
run: | | |
git submodule init | |
git submodule update | |
git lfs pull | |
working-directory: RiveGame | |
# required for hooks on macOS | |
- name: Make library/services in our temp directory, required for post checkout hook FixDependencyFiles.sh for macOS | |
run: | | |
mkdir -p "${{runner.temp}}/Library/Services" | |
echo "${{runner.temp}}/Library/Services" | |
ls -al "${{runner.temp}}/Library/Services" | |
- name: Clone UE5 Source | |
uses: actions/checkout@v2 | |
with: | |
repository: "EpicGames/UnrealEngine" # Adjust if using a fork | |
ref: "${{inputs.ENGINE_VERSION}}-release" | |
path: UE-${{inputs.ENGINE_VERSION}} | |
token: ${{ secrets.TOKEN }} # Ensure you have access to UE5 repo | |
clean: false | |
fetch-depth: 1 | |
continue-on-error: true | |
- name: Build UE5 | |
run: | | |
./Setup.sh | |
./GenerateProjectFiles.sh | |
working-directory: UE-${{inputs.ENGINE_VERSION}} | |
- name: Version info | |
run: | | |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
version=${GITHUB_REF#refs/tags/} | |
else | |
version=${GITHUB_SHA} | |
fi | |
echo "Setting VersionName to $version" | |
echo "GAME_VERSION=$version" >> $GITHUB_ENV | |
- name: build macOS; Not-universal, as RiveLibrary + UE doesn't support Universal, we have to make separate builds entirely | |
if: inputs.BUILD_MAC == true | |
run: | | |
./Engine/Build/BatchFiles/RunUAT.sh -ScriptsForProject="${{github.workspace}}/RiveGame/RiveGame.uproject" Turnkey -command=VerifySdk -platform=Mac -UpdateIfNeeded -project="${{github.workspace}}/RiveGame/RiveGame.uproject" BuildCookRun -nop4 -utf8output -cook -project="${{github.workspace}}/RiveGame/RiveGame.uproject" -target=LyraGame -platform=Mac -stage -archive -package -build -pak -iostore -compressed -prereqs -archivedirectory="${{github.workspace}}/RiveGame/Output" -manifests -clientconfig=Development | |
working-directory: UE-${{inputs.ENGINE_VERSION}} | |
- name: build iOS | |
if: inputs.BUILD_IOS == true | |
run: | | |
./Engine/Build/BatchFiles/RunUAT.sh -ScriptsForProject="${{github.workspace}}/RiveGame/RiveGame.uproject" Turnkey -command=VerifySdk -platform=IOS -UpdateIfNeeded -project="${{github.workspace}}/RiveGame/RiveGame.uproject" BuildCookRun -nop4 -utf8output -cook -project="${{github.workspace}}/RiveGame/RiveGame.uproject" -target=LyraGame -platform=IOS -stage -archive -package -build -pak -iostore -compressed -prereqs -archivedirectory="${{github.workspace}}/RiveGame/Output" -manifests -clientconfig=Development | |
working-directory: UE-${{inputs.ENGINE_VERSION}} | |
- name: Remove Saved files | |
run: | | |
find . -type d -name "Saved" -exec rm -rf {} + | |
working-directory: RiveGame/Output | |
- name: Archive Mac | |
if: inputs.BUILD_MAC == true | |
run: | | |
7z a -t7z -mx=9 ${{github.workspace}}/RiveGame/Mac.7z ${{github.workspace}}/RiveGame/Output/Mac/* | |
- name: Archive IOS | |
if: inputs.BUILD_IOS == true | |
run: | | |
7z a -t7z -mx=9 ${{github.workspace}}/RiveGame/IOS.7z ${{github.workspace}}/RiveGame/Output/IOS/* | |
- name: Upload Mac Artifacts | |
uses: actions/upload-artifact@v2 | |
if: inputs.BUILD_MAC == true | |
with: | |
name: RiveGame-Mac-${{ env.GAME_VERSION }}-ue-${{inputs.ENGINE_VERSION}} | |
path: RiveGame/Mac.7z | |
- name: Upload IOS Artifacts | |
uses: actions/upload-artifact@v2 | |
if: inputs.BUILD_IOS == true | |
with: | |
name: RiveGame-IOS-${{ env.GAME_VERSION }}-ue-${{inputs.ENGINE_VERSION}} | |
path: RiveGame/IOS.7z | |
build-game-allelse: | |
runs-on: Windows | |
if: inputs.BUILD_WINDOWS == true || inputs.BUILD_ANDROID == true | |
steps: | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- uses: actions/checkout@v3 | |
with: | |
clean: true | |
lfs: true | |
path: "RiveGame" | |
- name: init and pull lfs because checkout doesnt | |
run: | | |
git submodule init | |
git submodule update | |
git lfs pull | |
working-directory: RiveGame | |
- name: Clone UE5 Source | |
uses: actions/checkout@v2 | |
with: | |
repository: "EpicGames/UnrealEngine" # Adjust if using a fork | |
ref: "${{inputs.ENGINE_VERSION}}-release" | |
path: UE-${{inputs.ENGINE_VERSION}} | |
token: ${{ secrets.TOKEN }} # Ensure you have access to UE5 repo | |
clean: false | |
- name: Build UE5 | |
run: | | |
.\Setup.bat | |
.\GenerateProjectFiles.bat | |
working-directory: UE-${{inputs.ENGINE_VERSION}} | |
- name: Version info | |
run: | | |
if("${{ github.ref }}" -match "^refs/tags/") { | |
$version = "${{ github.ref }}".Replace("refs/tags/", "") | |
} else { | |
$version = "${{ github.sha }}" | |
} | |
Write-Host "Setting VersionName to $version" | |
echo "GAME_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append | |
- name: Build Win64 | |
if: inputs.BUILD_WINDOWS == true | |
run: | | |
./Engine/Build/BatchFiles/RunUAT.bat -ScriptsForProject="${{github.workspace}}/RiveGame/RiveGame.uproject" Turnkey -command=VerifySdk -platform=Win64 -UpdateIfNeeded -project="${{github.workspace}}/RiveGame/RiveGame.uproject" BuildCookRun -nop4 -utf8output -cook -project="${{github.workspace}}/RiveGame/RiveGame.uproject" -target=LyraGame -platform=Win64 -stage -archive -package -build -pak -iostore -compressed -prereqs -archivedirectory="${{github.workspace}}/RiveGame/Output" -manifests -clientconfig=Development | |
working-directory: UE-${{inputs.ENGINE_VERSION}} | |
- name: Build Android | |
if: inputs.BUILD_ANDROID == true | |
run: | | |
./Engine/Build/BatchFiles/RunUAT.bat -ScriptsForProject="${{github.workspace}}/RiveGame/RiveGame.uproject" Turnkey -command=VerifySdk -platform=Android -UpdateIfNeeded -project="${{github.workspace}}/RiveGame/RiveGame.uproject" BuildCookRun -nop4 -utf8output -cook -project="${{github.workspace}}/RiveGame/RiveGame.uproject" -target=LyraGame -platform=Android -stage -archive -package -build -pak -iostore -compressed -prereqs -archivedirectory="${{github.workspace}}/RiveGame/Output" -manifests -clientconfig=Development | |
working-directory: UE-${{inputs.ENGINE_VERSION}} | |
- name: Remove PDB, Saved files | |
run: | | |
Get-ChildItem "*.pdb" -Recurse | Remove-Item | |
Get-ChildItem -Include Saved -Recurse | Remove-Item -Recurse | |
working-directory: RiveGame/Output | |
- name: Archive Windows | |
if: inputs.BUILD_WINDOWS == true | |
run: | | |
7z.exe a -t7z -mx=9 ${{github.workspace}}/RiveGame/Windows.7z ${{github.workspace}}/RiveGame/Output/Windows/* | |
- name: Archive Android | |
if: inputs.BUILD_ANDROID == true | |
run: | | |
7z.exe a -t7z -mx=9 ${{github.workspace}}/RiveGame/Android.7z ${{github.workspace}}/RiveGame/Output/Android/* | |
- name: Upload Windows Artifacts | |
uses: actions/upload-artifact@v2 | |
if: inputs.BUILD_WINDOWS == true | |
with: | |
name: RiveGame-Win-${{ env.GAME_VERSION }}-ue-${{inputs.ENGINE_VERSION}} | |
path: RiveGame/Windows.7z | |
- name: Upload Android Artifacts | |
uses: actions/upload-artifact@v2 | |
if: inputs.BUILD_ANDROID == true | |
with: | |
name: RiveGame-Android-${{ env.GAME_VERSION }}-ue-${{inputs.ENGINE_VERSION}} | |
path: RiveGame/Android.7z |