You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can set the Android Bundle Version Code within the Build Profile itself. In this case I suppose that you would run the GitHub action with buildProfile: ... and versioning: None.
However, if you want to rely on the GitHub action to determine the version code... I think I have not implemented that--actually, it might even be impossible:
After we load the BuildProfile from the /Assets folder, the object has no public members or methods by which we can modify/edit the Build Profile at runtime.
From decompiled code, I can see that the BuildProfile class has internal classes and getter/setters, as well as private members, that hold the platform build settings and player overrides deserialized from the build profile asset. There also seems to be no public constructor, so you cannot instantiate/build the build profile at runtime.
I would guess that Unity will add these features/abilities in a later version, but they do not seem to be in Unity 6.1 Beta, yet.
So, I suppose the only possible solution today would be to modify (edit in place) the build profile's .asset YAML before launching the build. For instance, I just made a new Android Build Profile and set Bundle Version Code: 990099:
This resulted in this on line 206 of the .asset file:
- line: '| AndroidBundleVersionCode: 990099'
So we would have to Regex replace that 6-digit value before launching Unity.
After we load the BuildProfile from the /Assets folder, the object has no public members or methods by which we can modify/edit the Build Profile at runtime.
That might also be an argument to stick with the custom build method for now (I don't mean exclusively).
Per @MichaelBuhler
You can set the Android Bundle Version Code within the Build Profile itself. In this case I suppose that you would run the GitHub action with
buildProfile: ...
andversioning: None
.However, if you want to rely on the GitHub action to determine the version code... I think I have not implemented that--actually, it might even be impossible:
After we load the
BuildProfile
from the/Assets
folder, the object has no public members or methods by which we can modify/edit the Build Profile at runtime.From decompiled code, I can see that the
BuildProfile
class has internal classes and getter/setters, as well as private members, that hold the platform build settings and player overrides deserialized from the build profile asset. There also seems to be no public constructor, so you cannot instantiate/build the build profile at runtime.I would guess that Unity will add these features/abilities in a later version, but they do not seem to be in Unity 6.1 Beta, yet.
So, I suppose the only possible solution today would be to modify (edit in place) the build profile's
.asset
YAML before launching the build. For instance, I just made a new Android Build Profile and setBundle Version Code: 990099
:This resulted in this on line 206 of the
.asset
file:So we would have to Regex replace that 6-digit value before launching Unity.
Originally posted by @MichaelBuhler in #685 (comment)
The text was updated successfully, but these errors were encountered: