Comments (3)
You need to build addressables along with every build. I just made a script with it that you need to add to the Post-Build actions in the SUB window:
using SuperUnityBuild.BuildTool;
using System;
using UnityEditor;
using UnityEditor.AddressableAssets.Settings;
using UnityEditor.AddressableAssets;
using UnityEditor.AddressableAssets.Build;
using UnityEditor.Build.Pipeline.Utilities;
using UnityEngine;
namespace SuperUnityBuild.BuildActions
{
public class UploadAddressablePostBuild : BuildAction, IPostBuildPerPlatformAction
{
[Tooltip("True to upload the built addressables to your CCD. You must have this already set up.")]
[SerializeField] private bool _uploadToCcd=true;
public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform,
BuildArchitecture architecture, BuildScriptingBackend scriptingBackend,
BuildDistribution distribution, DateTime buildTime, ref BuildOptions options,
string configKey, string buildPath)
{
var settings = AddressableAssetSettingsDefaultObject.Settings;
// NOTE: you need to modify this to fit your addressable profile names
string profileName = platform.platformName == "PC" ? "Windows" : platform.platformName;
// set the active profile based on platform
string profileId = settings.profileSettings.GetProfileId(profileName);
settings.activeProfileId = profileId;
Debug.Log($"Setting active profile with name '{profileName}' to ID: " + settings.activeProfileId);
// addressables is currently bugged, so we have to clear the cache before building
// otherwise it'll get stuck in a dependency loop
var activeBuilder = settings.ActivePlayerDataBuilder;
AddressableAssetSettings.CleanPlayerContent(activeBuilder);
BuildCache.PurgeCache(false);
Caching.ClearCache();
// this will build your addressables based on your profile settings
AddressableAssetSettings.BuildPlayerContent(out AddressablesPlayerBuildResult result);
Debug.Log("Err: " + result.Error);
// this will upload the addressables to your CCD if true
if (_uploadToCcd)
{
var builderInput = new AddressablesDataBuilderInput(settings);
var task = CcdBuildEvents.Instance.UploadAndRelease(builderInput, result);
task.ContinueWith(t =>
{
Debug.Log("Upload and release succeeded: " + t.Result);
});
}
}
}
}
from buildactions.
@celojevic can you provide script "CcdBuildEvents" as it is referenced in above script or any other generic way to upload stuff?
from buildactions.
@celojevic can you provide script "CcdBuildEvents" as it is referenced in above script or any other generic way to upload stuff?
That script is part of the unity CCD management package
from buildactions.
Related Issues (20)
- Script Runner doesn't run PowerShell script HOT 1
- Add support for Android channel names
- UPM support HOT 1
- iOS utilities BuildAction HOT 1
- Add ability to change root folder.
- Upload to Steam Utility HOT 1
- Support for WebGL in UploadItch action HOT 1
- namespace 'BuildAction' could not be found HOT 5
- Problem with ZipFileOperation for large folders (+ possible solution) HOT 1
- Storing the Butler path separately from the rest of the config HOT 2
- Accessing version info in a Single Run action HOT 2
- How to build Dedicated Server? HOT 1
- Ambiguous reference with Ionic.Zip.ZipFile
- CS0173 on FileUtility line 42 : "no implicit conversion between 'method group' and 'method group'"
- Some way to know if a build failed in a post-build action
- UploadItch ships the BurstDebugInformation_DoNotShip
- PerBuildProjectSettings missing most options HOT 2
- SteamWorks support HOT 2
- Unit Test Utility
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buildactions.