unity-builder
unity-builder copied to clipboard
importing a package before building
what i'm trying to achieve is the ability to import external package before building the unity project.
tried to do this (without sucess):
- name: Import SDK
uses: game-ci/unity-test-runner@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
customParameters: -quit -batchmode -importPackage mypackage.unitypackage
can one get the unity executable path to run some unity commands such as:
- name: Import SDK
run: /opt/unity/Editor/Unity -importPackage mypackage.unitypackage
Builds should generally be deterministic. The imported package should be defined in your dependencies (and if need be used conditionally). I'd consider importing a package during CI time bad practice.
That said, I do not know your exact use case. Perhaps it's somehow warranted?
yes agree. usually it is a bad practice.
with that being said, the use case is having a unity project that its main goal is to test a unitypackage (sdk) file.
so actually each version of a unitypackage will be imported to this project and some tests will be executed with this imported package.
so now, when you can import in CI/CD, then you can execute tests versus multiple packages in a matrix manner.
Have you tried a custom build method with this: https://docs.unity3d.com/ScriptReference/AssetDatabase.ImportPackage.html