为 .NET Core 使用 Travis 设置 CI
Set up CI with Travis for .NET Core
我正在尝试为我的 .NET Core 3.1 class 库设置一个 CI。我在 https://travis-ci.org/github 创建了一个帐户,并选择了我的存储库,其中包含我的 class 库的代码,用于 CI 构建。
Travis 正在成功监视我的主分支的提交,但我无法使 CI 构建成功。
我的存储库:https://github.com/MintPlayer/MintPlayer.AspNetCore.SitemapXml
目标框架:.NET Core 3.1
我最新的.travis.yml文件:
language: csharp
mono: none
dotnet: 3.1.302
script:
- dotnet restore
dist: trusty
sudo: required
-
但不知何故这总是出错,这次输出如下:
干净的输出:
docker stop/waiting
resolvconf stop/waiting
C# support for Travis-CI is community maintained.
Please open any issues at https://travis-ci.community/c/languages/37-category and cc @joshua-anderson @akoeplinger @nterry
Installing .NET Core
$ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
$ export DOTNET_CLI_TELEMETRY_OPTOUT=1
E: Unable to locate package dotnet-sdk-3.1
E: Couldn't find any package by glob 'dotnet-sdk-3.1'
E: Couldn't find any package by regex 'dotnet-sdk-3.1'
The command "sudo apt-get install -qq dotnet-sdk-3.1=3.1.302*" failed and exited with 100 during .
Your build has been stopped.
-
我的 travis.yml 配置有什么问题。为什么我不能 CI 使用此配置测试我的 class 库?
我主要想CI测试.NET Core。如果可以包含单声道,那就太好了。您在 git 历史记录中找到的所有示例也是我在其他存储库中挖掘的示例。
您正在使用:
dist: trusty
那是 Ubuntu 14.04.6 LTS which is not supported by .NET Core 3.1。尝试 Ubuntu 的更新版本,例如 bionic
.
travis communitypost:
中也有回答
dotnet-sdk-3.0 is not available for Trusty (presumably because it’s EOL): https://packages.microsoft.com/ubuntu/14.04/prod/dists/trusty/main/binary-amd64/Packages Move to dist: xenial (which is the default so you can just omit it) or dist: bionic.
我正在尝试为我的 .NET Core 3.1 class 库设置一个 CI。我在 https://travis-ci.org/github 创建了一个帐户,并选择了我的存储库,其中包含我的 class 库的代码,用于 CI 构建。
Travis 正在成功监视我的主分支的提交,但我无法使 CI 构建成功。
我的存储库:https://github.com/MintPlayer/MintPlayer.AspNetCore.SitemapXml
目标框架:.NET Core 3.1
我最新的.travis.yml文件:
language: csharp mono: none dotnet: 3.1.302 script: - dotnet restore dist: trusty sudo: required
但不知何故这总是出错,这次输出如下:
干净的输出:
docker stop/waiting resolvconf stop/waiting C# support for Travis-CI is community maintained. Please open any issues at https://travis-ci.community/c/languages/37-category and cc @joshua-anderson @akoeplinger @nterry Installing .NET Core $ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 $ export DOTNET_CLI_TELEMETRY_OPTOUT=1 E: Unable to locate package dotnet-sdk-3.1 E: Couldn't find any package by glob 'dotnet-sdk-3.1' E: Couldn't find any package by regex 'dotnet-sdk-3.1' The command "sudo apt-get install -qq dotnet-sdk-3.1=3.1.302*" failed and exited with 100 during . Your build has been stopped.
我的 travis.yml 配置有什么问题。为什么我不能 CI 使用此配置测试我的 class 库?
我主要想CI测试.NET Core。如果可以包含单声道,那就太好了。您在 git 历史记录中找到的所有示例也是我在其他存储库中挖掘的示例。
您正在使用:
dist: trusty
那是 Ubuntu 14.04.6 LTS which is not supported by .NET Core 3.1。尝试 Ubuntu 的更新版本,例如 bionic
.
travis communitypost:
中也有回答dotnet-sdk-3.0 is not available for Trusty (presumably because it’s EOL): https://packages.microsoft.com/ubuntu/14.04/prod/dists/trusty/main/binary-amd64/Packages Move to dist: xenial (which is the default so you can just omit it) or dist: bionic.