Skip to content

Ue fixes (#10705) e6ba6e329a #40

Ue fixes (#10705) e6ba6e329a

Ue fixes (#10705) e6ba6e329a #40

Workflow file for this run

#### Secrets #####
# Requires "UNREAL_CI_PAT" 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
# 2. brew
## 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 Plugin
on:
workflow_dispatch:
inputs:
ENGINE_VERSION:
type: string
description: Unreal Engine Release Version
default: "5.3.2"
REF:
type: string
description: Branch or ref to build plugin source from
default: "main"
push:
tags:
- "*"
jobs:
build-plugin-apple:
runs-on: [self-hosted, macOS]
steps:
- name: setup
run: |
brew install jq
- uses: actions/checkout@v2
with:
clean: true
lfs: true
repository: "rive-app/rive-unreal"
path: "RiveUnreal"
ref: "${{inputs.REF}}"
- name: pull lfs because checkout doesnt
run: |
git lfs pull
working-directory: RiveUnreal
- 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"
ref: "${{inputs.ENGINE_VERSION}}-release"
path: UE-${{inputs.ENGINE_VERSION}}
token: ${{ secrets.UNREAL_CI_PAT }}
clean: false
fetch-depth: 1
continue-on-error: true
- name: Check if UE source successfully got fetched, we expect the previous checkout to fail due to UE posthook to FixDependencyFiles.sh using the ~ token to copy to Library/Services that doesnt exist in our environment
run: |
if [ ! -d "${{github.workspace}}/UE-${{inputs.ENGINE_VERSION}}" ]; then
echo "Did not successfully checkout UE source"
exit 1
fi
- 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 "RIVE_VERSION=$version" >> $GITHUB_ENV
upluginPath="${GITHUB_WORKSPACE}/RiveUnreal/Rive.uplugin"
jq '.VersionName = "'$version'"' "$upluginPath" > temp.json && mv temp.json "$upluginPath"
- name: Build Plugin macOS arm64
run: |
./Engine/Build/BatchFiles/RunUAT.sh -Verbose BuildPlugin -Plugin="${{github.workspace}}/RiveUnreal/Rive.uplugin" -Package="${{github.workspace}}/RiveUnreal/Output/Apple" -precompile -TargetPlatforms=Mac+IOS -Architecture_Mac=arm64
working-directory: UE-${{inputs.ENGINE_VERSION}}
- name: Build Plugin macOS x64
run: |
./Engine/Build/BatchFiles/RunUAT.sh -Verbose BuildPlugin -Plugin="${{github.workspace}}/RiveUnreal/Rive.uplugin" -Package="${{github.workspace}}/RiveUnreal/Output/x64" -precompile -TargetPlatforms=Mac -Architecture_Mac=x64
working-directory: UE-${{inputs.ENGINE_VERSION}}
- name: Copy x64 intermediates
run: |
cp -r "${{github.workspace}}/RiveUnreal/Output/x64/Intermediate/Build/Mac/x64" "${{github.workspace}}/RiveUnreal/Output/Apple/Intermediate/Build/Mac/"
- name: Upload macOS + iOS Artifacts
uses: actions/upload-artifact@v4
with:
name: RiveUnreal-${{ env.RIVE_VERSION }}-ue-${{ inputs.ENGINE_VERSION }}-apple
path: RiveUnreal/Output/Apple
build-plugin-allelse:
runs-on: [self-hosted, Windows]
steps:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- uses: actions/checkout@v2
with:
clean: true
lfs: true
repository: "rive-app/rive-unreal"
path: "RiveUnreal"
ref: "${{inputs.REF}}"
- name: pull lfs because checkout doesnt
run: |
git lfs pull
working-directory: RiveUnreal
- name: Clone UE5 Source
uses: actions/checkout@v2
with:
repository: "EpicGames/UnrealEngine"
ref: "${{inputs.ENGINE_VERSION}}-release"
path: UE-${{inputs.ENGINE_VERSION}}
token: ${{ secrets.UNREAL_CI_PAT }}
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 "RIVE_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append
$upluginPath = "${{github.workspace}}/RiveUnreal/Rive.uplugin"
$upluginContent = Get-Content $upluginPath | Out-String | ConvertFrom-Json
$upluginContent.VersionName = $version
$upluginContent | ConvertTo-Json -Depth 100 | Set-Content $upluginPath
- name: Build Win64 and Android Plugin
run: |
.\Engine\Build\BatchFiles\RunUAT.bat -Verbose BuildPlugin -Plugin="${{github.workspace}}/RiveUnreal/Rive.uplugin" -Package="${{github.workspace}}/RiveUnreal/Output" -precompile -TargetPlatforms=Win64+Android
working-directory: UE-${{inputs.ENGINE_VERSION}}
- name: Remove PDB files
run: |
Get-ChildItem "${{github.workspace}}/RiveUnreal/Output/Binaries/*.pdb" -Recurse | Remove-Item
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RiveUnreal-${{ env.RIVE_VERSION }}-ue-${{ inputs.ENGINE_VERSION}}
path: RiveUnreal/Output
combine-binaries:
needs: [build-plugin-apple, build-plugin-allelse]
runs-on: ubuntu-latest
steps:
- 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 "RIVE_VERSION=$version" >> $GITHUB_ENV
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Print folder
run: |
ls -al artifacts
ls -al artifacts/RiveUnreal-${{ env.RIVE_VERSION }}-ue-${{ inputs.ENGINE_VERSION}}/Binaries
ls -al artifacts/RiveUnreal-${{ env.RIVE_VERSION }}-ue-${{ inputs.ENGINE_VERSION}}/Intermediate/Build
- name: Combine
run: |
cp -r ./artifacts/RiveUnreal-${{ env.RIVE_VERSION }}-ue-${{ inputs.ENGINE_VERSION}}-apple/* ./artifacts/RiveUnreal-${{ env.RIVE_VERSION }}-ue-${{ inputs.ENGINE_VERSION}}/
- name: Zip
run: |
cd "artifacts/RiveUnreal-${{ env.RIVE_VERSION }}-ue-${{ inputs.ENGINE_VERSION}}"
zip -r ../../RiveUnreal-${{ env.RIVE_VERSION }}.zip .
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: RiveUnreal-${{ env.RIVE_VERSION }}.zip