Docs

Version File

Packaging a text file artifact containing the version string with every build.

If Write Version File is enabled, every build will stage and package a small text file that holds the formatted version string. It can be useful for archiving with a build or for automation to read in later jobs.

File name format

The default name format is version.{config}.txt. Change the Version File Name setting to define a different name.

The following replacement tokens are supported:

TokenReplaced with
{config}The build configuration, such as Development or Shipping.
{platform}The platform, such as Windows or Linux.
{target}The target name, such as MyGameServer.

The filename cannot contain any path information. If any invalid characters are found a warning is printed in the build log and Version Forge uses the default name.

Where the file is written to

During compilation Version Forge writes the file directly to your project folder root. Packaging then copies it to the build output directory next to the Content folder.

For example, a Windows Shipping build of MyGame will contain:

Windows/MyGame/version.Shipping.txt

Keep the {config} token in the name format

If you compile and package multiple configurations together, for example Development+Shipping, each target writes its version file to the same project folder and packages it into the same package. Since a Development build and a Shipping build can have different version strings, one of them will overwrite the other if they use the same filename.

In this case it's recommended to keep the {config} token as part of the file name so that each target's version file ends up in the package folder separately.

When the file is and is not written

If enabled, a normal CI/CD build will output the file. However, the file will not be written for:

  • Local builds.
  • Editor builds.

If you package your project outside of a CI/CD system and want it to output a Version File, define a build number when packaging. See Local Builds and Command Line Arguments.

Source control

Since the file is written to your project folder root it can appear as a change in source control. It does not need to be checked in, so add version.*.txt (or a pattern matching your custom filename format) to your ignore file to prevent this.

Important: If compilation and packaging happen on different nodes, for example with BuildGraph, you must make sure this file is copied to your packaging agent. See Distributed builds.

On this page