#StackBounty: #unity3d #continuous-integration #gitlab #gitlab-ci #gitlab-ci-runner Gitlab-CI: set different variables/paths depending …

Bounty: 100

I am using Gitlab CI to automate my unity builds. For this I use two machines. (one Mac and one windows machine. Important: build should only run on the first machine that is available. )

unity-build:
  script: "/Applications/Unity/Hub/Editor/2019.3.14f1/Unity.app/Contents/MacOS/Unity       
  -projectPath pathXY 
  -executeMethod BuildScript.PerformBuild
  -quit"
  stage: build
  tags:
    - unity-mac-runner, unity windows runner

The problematic line is this: script: "/Applications/Unity/Hub/Editor/2019.3.14f1/Unity.app/Contents/MacOS/Unity, because on my windows runner path to unity is "S:Unity2019.3.14f1EditorUnity.exe"

Tried to fix this with these changes:

windows job:
  stage: setpaths
  variables:
    UNITY_PATH: "S:/Unity/2019.3.14f1/Editor/Unity.exe"
  script: "set windows variables..."
  tags:
    - unity windows runner
#osx job:
#  stage: setpaths
#  variables:
#    UNITY_PATH: "S:/Unity/2019.3.14f1/Editor/Unity.exe"
#  script: "set mac variables..."
#  tags:
#    - unity-mac-runner

Questions

  1. How can I do this? What should I use?
  2. I tried to set path of unity installation depending on build runner, but I couldn’t get this to work.

An example would be nice. Thx a lot 😉


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.