Description
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: ...
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.
Originally posted by @MichaelBuhler in #685 (comment)