我如何使用“此提要”中的工件我的管道中的来源?
我已成功将 NuGet 包推送到 Azure DevOps Artifacts 中的源:
但是,我想在我的管道中使用此包,因为当前失败,因为它找不到该包。我尝试使用创建工件提要时获得的 URL 在项目设置中添加服务连接:
< img src="https://i.sstatic.net/1P0nX.png" alt="在此处输入图像描述">
但是,我的构建仍然失败,因为它找不到包。
这是我的管道 YAML 文件:
trigger:
batch: true
branches:
include:
- master
- develop
- release/*
pr:
autoCancel: false
branches:
include:
- master
- develop
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetAuthenticate@0
inputs:
nuGetServiceConnections: 'Azure DevOPS Nuget feed (see Artifacts)'
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
feedsToUse: config
nugetConfigPath: nuget.config
externalFeedCredentials: 'Azure DevOPS Nuget feed (see Artifacts)'
- task: GitVersion@5
inputs:
runtime: 'full'
updateAssemblyInfo: true
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
更新:它现在似乎转到了正确的 NuGet 源,但无法在步骤 NuGetCommand
中进行身份验证。
如何使用刚刚推送到 Azure DevOps 中的 Artifact feed 的 NuGet 包?
I have successfully pushed my NuGet package to a feed in my Azure DevOps Artifacts:
But, I want to use this package in my pipeline, because this currently fails because it cannot find the package. I tried to add a service connection in my Project Settings, using the URL I get when creating the artifact feed:
But still, my build fails because it cannot find the package.
This is my pipeline YAML file:
trigger:
batch: true
branches:
include:
- master
- develop
- release/*
pr:
autoCancel: false
branches:
include:
- master
- develop
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetAuthenticate@0
inputs:
nuGetServiceConnections: 'Azure DevOPS Nuget feed (see Artifacts)'
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
feedsToUse: config
nugetConfigPath: nuget.config
externalFeedCredentials: 'Azure DevOPS Nuget feed (see Artifacts)'
- task: GitVersion@5
inputs:
runtime: 'full'
updateAssemblyInfo: true
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
Update: it seems to go to the correct NuGet feed now, but it fails to authenticate in step NuGetCommand
.
How can I use the NuGet package I just pushed to the Artifact feed in Azure DevOps?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用 DevOps YAML 编辑器将正确的步骤添加到我的
azure-pipelines.yml
中。我添加了一个 NuGet 步骤:在
使用此 Azure Artifacts/TFS feed 中的包
选项中,我可以选择我的 Artifacts feed。这将此任务添加到 YAML 文件中:并且成功了!
I used the DevOps YAML editor to add the correct steps to my
azure-pipelines.yml
. I added a NuGet step:In the
Use packages from this Azure Artifacts/TFS feed
option, I could select my Artifacts feed. This added this task to the YAML file:And it worked!