unity-builder
unity-builder copied to clipboard
Generating a unitypackage using unity-builder
Context
Hello! Thank you for this wonderful GH action, supporting docs etc - great stuff. I am a library developer and publish a "unitypackage" that Unity developers can import into their project: https://github.com/mParticle/mparticle-unity-plugin
We would like to generate our unitypackage with GH actions.
Suggested solution
We have a bash script that we currently run locally, it looks something like this:
/Applications/Unity/Unity.app/Contents/MacOS/Unity \
-projectPath "${PWD}" \
-logFile \
-exportPackage Assets/foo.cs \
Assets/bar.cs
Example.unitypackage -nographics -batchmode -quit;
You can see a full example here: https://github.com/mParticle/mparticle-unity-plugin/blob/master/buildscript.sh
Seems like the critical parameter that the GH action would have to take is the list of assets to export.
Considered alternatives
We tried to hack our way around and run bash script in the docker image created by unity-builder but paused as it was getting too unsustainable.
Additional details
Supporting the development of unitypackage's/sdks would increase your product's TAM such that it's even more useful to library developers vs only app developers :-)
Accepting contributions for this.
There is a related documentation issue here which points to an example someone shared a while ago:
https://github.com/game-ci/documentation/issues/51
It seems Epic Online Services has a method for building a Unity package from an editor script. Combined with the customBuildMethod parameter, in theory, this should allow GameCI to build unitypackages. They also have methods for building UPM packages too.
https://github.com/PlayEveryWare/eos_plugin_for_unity/blob/183a25463a8c1ed87e5a4c52c107f7596dfcd531/Assets/Plugins/Source/Editor/Internal/UnityPackageCreationTool.cs