无法使用 Windows Gitlab Runner 找到 Unity 的构建输出

Cannot find build output of Unity with Windows GitlabRunner

我目前正在为 Unity 配置 Windows GitlabRunner。

实际上根据日志文件构建似乎成功,但是我找不到命令中指定的文件夹输出。

这是我的.gitlab-ci.yml

before_script:


stages:
  - unity-build
  - mr-build
  - package-appx

unity-build-job:
  stage: unity-build
  script:
    - D:/Programmes/Editor/Unity.exe -logFile "./unitylog.txt" -buildOutput "./Build" -duskBuildTarget WSAPlayer -wsaUWPBuildType D3D -executeMethod HoloToolkit.Unity.BuildSLNUtilities.PerformBuild_CommandLine -batchmode -quit
  artifacts:
    when: always
    paths:
    - unitylog.txt
    - Build/
    expire_in: 1 hour

我的 unitylog.txt 到此结束:

...
Reloading assemblies after script compilation.
Begin MonoManager ReloadAssembly
Refreshing native plugins compatible for Editor in 336.09 ms, found 11 plugins.
Preloading 2 native plugins for Editor in 0.13 ms.
Mono: successfully reloaded assembly
Refreshing native plugins compatible for Editor in 1.06 ms, found 11 plugins.
Preloading 2 native plugins for Editor in 0.10 ms.

----- Total AssetImport time: 0.190096s, AssetImport time: 0.000000s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]

- Completed reload, in  2.095 seconds
Initializing Unity.PackageManager (PackageManager) v2017.2.1 for Unity v2017.2.1f1
Registering platform support modules:
Registered platform support modules in: 0.0496227s.
Native extension for OSXStandalone target not found
Native extension for WindowsStandalone target not found
Native extension for LinuxStandalone target not found
Native extension for WebGL target not found
Native extension for Metro target not found
Native extension for iOS target not found
Native extension for Android target not found
Batchmode quit successfully invoked - shutting down!
Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.119714 seconds (Nothing changed)
Updating ProjectSettings/ProjectSettings.asset - GUID: 00000000000000004000000000000000...
 done. [Time: 47.385449 ms] 
Refreshing native plugins compatible for Editor in 1.15 ms, found 11 plugins.
Preloading 2 native plugins for Editor in 0.09 ms.

----- Total AssetImport time: 0.149189s, AssetImport time: 0.082687s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]

Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.124676 seconds (Nothing changed)
[Package Manager] Server::Kill -- Server was shutdown
Cleanup mono
Exiting batchmode successfully now!
debugger-agent: Unable to listen on 4160

这是我的 gitlab-runner 的输出

Running with gitlab-runner 10.8.0 (079aad9e)
  on xxxxxx 65400cd9
Using Shell executor...
Running on DESKTOP-xxxxx...
Fetching changes...
Removing unitylog.txt
HEAD is now at 670a573 Comment build condition
From xxxxx
   670a573..f124d71  add-CI     -> origin/add-CI
Checking out f124d719 as add-CI...
Skipping Git submodules setup
$ D:/Programmes/Editor/Unity.exe -logFile "./unitylog.txt" -buildOutput "./Build" -duskBuildTarget WSAPlayer -wsaUWPBuildType D3D -executeMethod HoloToolkit.Unity.BuildSLNUtilities.PerformBuild_CommandLine -batchmode -quit
Uploading artifacts...
unitylog.txt: found 1 matching files               
WARNING: Build/: no matching files                 
Uploading artifacts to coordinator... ok            id=40 responseStatus=201 Created token=APuuG8xj
Job succeeded

感谢您的帮助。

问题是我的 Unity 构建命令行没有 --projectPath 选项。我认为如果不提供项目路径,Unity 会在当前目录中打开项目(或至少输出错误),但它似乎打开了上次打开的项目,所以它根本没有构建正确的项目。