在Travis中针对多个.Net核心版本构建多个解决方案

时间:2019-05-24 15:09:21

标签: .net-core travis-ci

我的存储库中有两个.Net Core解决方案,一个针对.Net Core 2.2,另一个针对.Net Core 3。 我希望Travis构建这两个解决方案,但是我只能在.travis.yml中指定一个版本,因此另一个项目无法构建。

我的.travis.yml:

dist: xenial 
language: csharp
mono: none
dotnet: 2.2
script:
  #Build Major Application
  - dotnet restore NetCore22Solution/NetCore22Solution.sln
  - dotnet build NetCore22Solution/NetCore22Solution.sln

  #Build Services
  - dotnet restore NetCore3Solution/NetCore3Solution.sln
  - dotnet build NetCore3Solution/NetCore3Solution.sln

如何指定我还需要.Net Core 3?

我搜索了travis的c#论坛,github问题以及显然的google,但未找到任何解决方案。

1 个答案:

答案 0 :(得分:0)

我尝试将所需的版本作为软件包添加,并且有效:

addons:
  apt:
    packages:
    - dotnet-sdk-3.0

Travis诚实地下载并安装了SDK。

相关问题