Update server docs #155
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
name: Build - Linux - Server - Dev | |
on: | |
push: | |
branches: | |
- dev | |
workflow_dispatch: | |
inputs: | |
buildAll: | |
type: choice | |
description: 'Build all BEAMPROJS.' | |
required: true | |
default: "false" | |
options: | |
- "true" | |
- "false" | |
workflow_call: | |
inputs: | |
buildAll: | |
type: string | |
description: 'Build all BEAMPROJS.' | |
required: true | |
default: false | |
permissions: | |
contents: write | |
jobs: | |
unifyInputs: | |
runs-on: [self-hosted, Windows] | |
outputs: | |
buildAll: ${{ steps.unifyBuildAll.outputs.buildAll }} | |
steps: | |
- name: Set environment variables | |
id: unifyBuildAll | |
shell: bash | |
run: echo "buildAll=${{ inputs.buildAll || 'false' }}" >> $GITHUB_OUTPUT | |
changes: | |
needs: unifyInputs | |
runs-on: [self-hosted, Windows] | |
# This job only runs if we are looking for changes | |
if: | | |
always() && | |
needs.unifyInputs.outputs.buildAll == 'false' | |
# Expose the list of changed "BEAMPROJ_XXXXX" that were found (this maps to the filter names) | |
outputs: | |
BEAMPROJS: ${{ steps.filter.outputs.changes }} | |
# Clone the repo and find the changed "BEAMPROJ_XXXXX" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
# Check against previous commit | |
base: ${{ github.ref }} | |
# The filters here are BEAMPROJ-specific. | |
# We should only rebuild artifacts for a specific BEAMPROJ if there are changes to files it considers relevant. | |
filters: | | |
BEAMPROJ_HathoraDemo: | |
- 'Plugins/BEAMPROJ_HathoraDemo/**' | |
- 'Plugins/BeamableCore/**' | |
- 'Plugins/OnlineSubsystemBeamable/**' | |
- 'Dockerfile' | |
- '**.sh' | |
- 'Source/**' | |
- '*.uproject' | |
- name: Cleanup workspace | |
if: always() | |
shell: bash | |
run: rm -rf .* && rm -rf * | |
build: | |
needs: [unifyInputs, changes] | |
uses: ./.github/workflows/build_windows.yml | |
# Only run this if the changes job actually detected changes OR if we are building all. | |
# Empty array will be serialized as [] so you can simply check it in the if condition. | |
if: | | |
always() && | |
(needs.unifyInputs.result == 'success') && | |
(needs.changes.result == 'success' || needs.changes.result == 'skipped') && | |
(needs.changes.outputs.BEAMPROJS != '[]' && needs.changes.outputs.BEAMPROJS != '') || (needs.unifyInputs.outputs.buildAll == 'true') | |
strategy: | |
max-parallel: 1 | |
matrix: | |
# Result of changes job as well as vars are plain strings. That's why you have to use fromJson() to parse it into array. | |
# The list of BeamProj is defined by "wherever we detected changes" when inputs.buildAll is false | |
# The list of BeamProj is Repository Variable (declared in Github's UnrealSDK's Settings -> Secrets & Variables -> Variables). | |
beamProj: ${{ needs.unifyInputs.outputs.buildAll == 'false' && fromJSON(needs.changes.outputs.BEAMPROJS) || fromJSON(vars.ALL_SERVER_BEAMPROJS) }} | |
with: | |
beamProj: ${{ matrix.beamProj }} | |
buildType: server | |
targetPlatform: "Linux" |