Unreal Engine 5 Windows build template

TeamCity UE5 build config that I use for Project Rising

Thu, 03 Aug 2023

Full code

<?xml version="1.0" encoding="UTF-8"?>
<template xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" uuid="a5b8ea9f-5689-4993-9848-b0ae0b62f081" xsi:noNamespaceSchemaLocation="https://www.jetbrains.com/teamcity/schemas/2021.1/project-config.xsd">
  <name>Unreal Game Build</name>
  <settings>
    <options>
      <option name="artifactRules" value="%teamcity.build.workingDir%\dist\Windows =&gt; ." />
      <option name="buildNumberPattern" value="%version_name%.%build.counter%" />
      <option name="checkoutMode" value="ON_AGENT" />
      <option name="publishArtifactCondition" value="SUCCESSFUL" />
    </options>
    <parameters>
      <param name="DDC_PASS" value="%keyvault:tds-devops/yennefer-service-password%" />
      <param name="DDC_USER" value="%keyvault:tds-devops/yennefer-service-user%" />
      <param name="version_name" value="0.1.0" />
    </parameters>
    <build-runners>
      <runner id="RUNNER_9" name="Update Project Version" type="simpleRunner">
        <parameters>
          <param name="plugin.docker.imagePlatform" value="windows" />
          <param name="plugin.docker.pull.enabled" value="true" />
          <param name="script.content"><![CDATA[attrib -r %system.teamcity.build.workingDir%\\Config\\DefaultGame.ini
unreal-ci projectVersion set -v %build.number%]]></param>
          <param name="teamcity.step.mode" value="default" />
          <param name="use.custom.script" value="true" />
        </parameters>
      </runner>
      <runner id="RUNNER_44" name="Clean Dist" type="simpleRunner">
        <parameters>
          <param name="plugin.docker.imagePlatform" value="windows" />
          <param name="plugin.docker.pull.enabled" value="true" />
          <param name="script.content" value="unreal-ci clean dist" />
          <param name="teamcity.step.mode" value="default" />
          <param name="use.custom.script" value="true" />
        </parameters>
      </runner>
      <runner id="RUNNER_10" name="Build Windows Client" type="simpleRunner">
        <parameters>
          <param name="plugin.docker.imageId" value="eddiebeazer/unreal-engine:%UNREAL_ENGINE_VERSION%" />
          <param name="plugin.docker.imagePlatform" value="windows" />
          <param name="script.content"><![CDATA[net use Z: \\&SERVER_NAME%\ddc /user:%DDC_USER% %DDC_PASS%
ue4 package Shipping]]></param>
          <param name="teamcity.step.mode" value="default" />
          <param name="use.custom.script" value="true" />
        </parameters>
      </runner>
    </build-runners>
    <vcs-settings />
    <requirements />
    <build-triggers />
    <build-extensions>
      <extension id="perfmon" type="perfmon">
        <parameters />
      </extension>
      <extension id="DockerSupport" type="DockerSupport">
        <parameters>
          <param name="login2registry" value="PROJECT_EXT_3" />
          <param name="loginCheckbox" value="on" />
        </parameters>
      </extension>
      <extension id="jetbrains.agent.free.space" type="jetbrains.agent.free.space">
        <parameters>
          <param name="free-space-fail-start" value="true" />
          <param name="free-space-work" value="50gb" />
        </parameters>
      </extension>
    </build-extensions>
    <cleanup />
  </settings>
</template>

This template updates the project version to the build number, cleans the archive directory and builds the game. Lets break it down

  1. Update Project Version. This first updates the project version of the game. Totally not needed but I like to do it so I can easily identify what build of my game that someone is running in the event they run into issues. One thing worth noting, this relies on a CLI I made. The CLI will just edit the ini file where the project version is pulled from
attrib -r %system.teamcity.build.workingDir%\\Config\\DefaultGame.ini
unreal-ci projectVersion set -v %build.number%

I use Perforce as a VCS so when I checkout files they are automatically read only. The attri -r makes the file writable. After that the unreal-ci command just updates the games Project Version parameter to the build number

  1. I use the unreal-ci that I made again to delete the archive folder.
unreal-ci clean dist
  1. The final step is to build the game
ue4 package Shipping

Documentation on the ue4 package command can be found in the link

Buy Me A CoffeeDigitalOcean Referral Badge
Loading...
Edward Beazer

Edward Beazer - I just like to build shit. Sometimes I get stuck for hours, even days while trying to figure out how to solve an issue or implement a new feature. Hope my tips and tutorials can save you some time.

DigitalOcean Referral Badge