Build Addressables with Build Automation

Addressable Assets are assets that have a unique address which you can use to load them from local or remote AssetBundles.

Prerequisites

Before you can build Addressable Assets in Build Automation, you must:

  • Convert your project to use Addressables locally:
  • Commit your updated project to your chosen version control system (VCS).

Build configuration

To start from a new Build Automation project, you need to create a new build configuration first.

  1. Sign in to the Unity Cloud Dashboard.
  2. Select DevOps > Build automation > Configurations.
  3. Select the build configuration to build Addressables for.
  4. Select Edit.
  5. From the Advanced settings tab, select Yes, build Addressables.

Use the Addressables section to configure properties that determine how the Addressables build process behaves. Tooltips describe each property in more detail.

Run a new Addressables build

To run a new Addressables build,

  1. Go to DevOps > Build automation > Configurations.
  2. Select a build configuration that has Addressables settings configured.
  3. Select Build.

For more information, refer to Run builds manually.

Enable Cloud Content Delivery service

To upload Addressables to the Cloud Content Delivery (CCD) service from Build Automation:

  1. From your build targets advanced settings, navigate to the Addressables section.
  2. Select Upload Addressables to the Cloud Content Delivery service.
  3. Select the required CCD bucket in the Content Delivery Bucket drop-down.
  4. If your Content Delivery API Key isn't populated in its field, add the API key.
  5. To automatically create a CCD release from the selected bucket, select Automatically create a Cloud Content Delivery release from the bucket.
  6. Select Save and build.

For more information about using Addressables with CCD, refer to CCD + Addressables walkthrough.

Run a content-update build

Content update builds update a previously built player with new addressable content.

To update the existing player, update builds require a Content State file. This links the content from an Update build to an existing player. The Content State file generates when you do a new Addressables build.

To update a previously built player with new Addressable assets:

  1. Select Edit Addressables Asset Options.
  2. Select Yes, build Addressables and Make a content-update build.
  3. Select Make a content-only build, unless you want to produce another Player.
  4. Set the content state file location method to define how Build Automation gets the Content State file.
    Build Automation can get this file in the following ways.
    • To get the file from source control, specify the path.
    • To get the file from an existing build target which has previously successfully built Addressables, specify the target.

Build Automation can automatically use the most recent Content State file produced by the selected Build Target.

Start a build

When the build target is configured, to start a new Addressables build:

  1. Navigate to Build Automation, Build History.
  2. Build the target you’ve configured Addressables for. See Run builds manually for more information about how to run builds.

When the new build has successfully completed, the More menu (⋮) for the build displays the Download Addressable Assets option.

Copy Addressables content from Build Automation to your hosting provider

Once you complete an Addressables build, you can copy the Addressables content from Build Automation to your hosting provider. You can copy the content manually, or use a post-build script.

Copy Addressables content manually

Once you complete an Addressables build, select Download Addressables Assets from the More menu (⋮). When you download the content, you can upload it to your hosting provider when you build locally.

Copy Addressables content with a post-build script

Build Automation supports running a custom shell script before or after a build. You can create a post-build script to automatically upload your Addressables content when a build successfully completes.

To enable a post-build script:

  1. Navigate to the Build Automation Configurations page.
  2. On your Build Target, select Edit Advanced Options.
  3. In the Post-Build Script Path field, enter the path to your script.

Consider the following information when you write your script:

  • The Addressable content for your build is located at $OUTPUT_DIRECTORY/extra_data/addrs.
  • You can set environment variables for secret keys in the Build Target Configurations page.