unity-builder icon indicating copy to clipboard operation
unity-builder copied to clipboard

Generating a unitypackage using unity-builder

Open samdozor opened this issue 3 years ago • 3 comments

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 :-)

samdozor avatar Mar 30 '21 15:03 samdozor

Accepting contributions for this.

webbertakken avatar Apr 02 '21 11:04 webbertakken

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

GabLeRoux avatar Apr 02 '21 12:04 GabLeRoux

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

AndrewKahr avatar Mar 04 '23 22:03 AndrewKahr