简体   繁体   English

从 yaml 管道向组织提要发布 NuGet package

[英]Publishing a NuGet package to an organization feed from yaml pipeline

Having trouble publishing a NuGet package from a yaml pipeline, restore/build/pack all works ok it's just the pushing that is failing and it seems to be related to the Push generating a bad url for the Artefact feed that I am pushing the package to.从 yaml 管道发布 NuGet package 时遇到问题,恢复/构建/打包一切正常,这只是推送失败,它似乎与我将 package 推送到的 Artefact 提要生成错误 url 的推送有关.

I've been able to push the package from a NuGet command locally and connect to the Artefact feed, the "d____i" is an organization scoped feed and the library is in that feed as you can see, the url seems incorrect to what I get when I go to the "Connect to feed" from the DevOps page, which looks like this below我已经能够从本地的 NuGet 命令推送 package 并连接到 Artefact 提要,“d____i”是一个组织范围的提要,并且库在该提要中,如您所见,url 似乎与我得到的不正确当我 go 从 DevOps 页面转到“连接到提要”时,如下所示

<add key="d_____i" value="https://pkgs.dev.azure.com/d_____i/_packaging/d_____i/nuget/v3/index.json" />

推送失败 用于推送的 yaml 管道设置

I'm actually back here again because I had a long break working on some other stuff but now I am back to having to publish my packages to a feed and I'm still running into the same issue.我实际上又回到了这里,因为我在其他一些事情上休息了很长时间,但现在我又不得不将我的包发布到提要,但我仍然遇到同样的问题。

Different projects but essentially the same issue.不同的项目,但本质上是同一个问题。

I've given the source project Build Service COntributor access to the target project scoped feed and that didn't work.我已经为源项目 Build Service COntributor 提供了对目标项目范围内提要的访问权限,但这没有用。

I've tried a custom nuget.config but I get 401 errors.我试过自定义 nuget.config,但出现 401 错误。

Just strugging with this so bad, I have decided to create a support ticket with Microsoft because I can't believe this is so hard, I'm sure it's not but it's driving me crazy and I'm simply can't move forward now.只是为此苦苦挣扎,我决定与 Microsoft 一起创建支持票,因为我不敢相信这太难了,我敢肯定不是,但这让我发疯了,我现在根本无法前进.

Here is my pipeline这是我的管道

在此处输入图像描述

Everything works apart from the last step and I get the following error除最后一步外一切正常,我收到以下错误

error: Unable to load the service index for source https://pkgs.dev.azure.com/dorsavi/f021750e-bf44-48e3-8892-3afd18dcddca/_packaging/bf8fd47b-0475-41e9-80fc-8e5c23e7ff8b/nuget/v3/index.json .错误:无法加载源的服务索引https://pkgs.dev.azure.com/dorsavi/f021750e-bf44-48e3-8892-3afd18dcddca/_packaging/bf8fd47b-0475-41e9-80fc-8ffe5b/nuget73索引.json error: Response status code does not indicate success: 404 (Not Found - VS800075: The project with id 'vstfs:///Classification/TeamProject/f021750e-bf44-48e3-8892-3afd18dcddca' does not exist, or you do not have permission to access it. (DevOps Activity ID: 97338923-B00F-4CE5-BB79-0D6BF964864C)).错误:响应状态代码不表示成功:404(未找到 - VS800075:ID 为“vstfs:///Classification/TeamProject/f021750e-bf44-48e3-8892-3afd18dcddca”的项目不存在,或者您没有访问它的权限。(DevOps 活动 ID:97338923-B00F-4CE5-BB79-0D6BF964864C))。

I'm still going at it, trying different configurations with the push command but so far nothing has worked, including using guids or names of projects/feeds我仍在努力,尝试使用 push 命令进行不同的配置,但到目前为止没有任何效果,包括使用 guid 或项目/提要的名称

I'm trying to go from one project "CompanyName.Logging" this has the build pipeline and I'm trying to push to a feed which is a project scoped feed called "CompanyName.Platform" in a project called "CompanyName.Platform" both projects are in the same organization.我正在尝试从一个项目“CompanyName.Logging”到 go,它具有构建管道,我正在尝试推送到一个提要,这是一个名为“CompanyName.Platform”的项目中名为“CompanyName.Platform”的项目范围提要这两个项目都在同一个组织中。

If I try to push to a feed called Test in "ComnpanyName.Logging" it works fine.如果我尝试推送到“ComnpanyName.Logging”中名为 Test 的提要,它工作正常。

It appears to me your publishVstsFeed isn't set correctly.在我看来,您的publishVstsFeed设置不正确。 You would expect to see a GUID of the feed or name (I think in your case, d_____i ) here and the path to the package in the packagesToPush property.您会希望在此处看到提要或名称的 GUID(我认为在您的情况下为d_____i )以及packagesToPush属性中 package 的路径。

This is documented in the task documentation for NuGetCommand@2 .这记录在NuGetCommand@2的任务文档中。

Example:例子:

- task: NuGetCommand@2
  inputs:
    command: 'push'
    nuGetFeedType: 'internal'
    publishVstsFeed: '99303781-4bbb-41d6-a13e-fe40603b9cb7'
    packagesToPush: 'packages/*.nupkg'
    allowPackageConflicts: true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在组织团队中发布机器人 - Publishing a bot in an organization teams Telerik Nuget package 在 Azure 中恢复构建管道失败 - Telerik Nuget package restore in Azure build pipeline fails AzureDevops static 网站未从私人订阅源中找到 NuGet 包 - AzureDevops static website not finding NuGet packages from private feed 如何从yaml管道访问Azure Devops API? - How to access Azure Devops API from yaml pipeline? 从 YAML Azure 管道中的 Git 服务连接访问变量 - Access Variables From Git Service Connection in a YAML Azure Pipeline 在 Azure 管道中安装来自 Azure DevOps Artifact Feed 的包 - Installing packages from Azure DevOps Artifact Feed in a Azure Pipeline 当构建管道不生成工件时,如何防止 YAML 部署管道运行 - How to prevent a YAML Deployment Pipeline from running when the Build Pipeline doesn't produce an artifact 已删除/已创建资源的 Cloud Asset Organization 提要 - Cloud Asset Organization feed for deleted/created resource 如何使用 C# 从 Azure Devops 中的 Artifacts/Nuget Feed 获取所有包及其版本的列表? - How to get the list of all the packages with their versions from Artifacts/Nuget Feed in Azure Devops using C#? 如何使用 YAML 从 Azure Devops 管道执行和安排 Databricks Notebook - How can I execute and schedule Databricks notebook from Azure Devops Pipeline using YAML
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM