【问题标题】:migrate Azure Devops artifacts to GitHub packages将 Azure Devops 项目迁移到 GitHub 包
【发布时间】:2022-12-03 11:41:29
【问题描述】:

有什么简单的方法可以将 Azure Devops 工件迁移到 GitHub 包吗?我们需要迁移的工件很少。是否有任何工具可用于执行此操作?

【问题讨论】:

  • Yeshwanth 你得到什么了吗?

标签: azure-devops github-packages


【解决方案1】:

按照以下步骤执行迁移操作。

dotnet tool install gpr -g
gpr push MyFakePackage.1.0.0.50.nupkg --repository https://github.com/MyRepo/my-repo-name

这两个是迁移时要遵循的简单的两行语法。

【讨论】:

  • 粘贴一些代码并不能解释发生了什么。如果你能分享一些文档或者为什么/这是做什么的,那就太好了
【解决方案2】:

我在这里扩展了@TadepalliSairam 的解决方案:https://josh-ops.com/posts/github-packages-migrate-nuget-packages-to-github-packages/。这是一篇详细介绍将 .nupkg 文件迁移到 GitHub Packages 的脚本的帖子。

基本上,您必须使用 gpr,因为它会在推送之前重写 .nupkg 中 .nuspec 文件中的 <repository url="..." /> 元素。

dotnet nuget push 无法执行此操作,您现在将收到 400 错误:

dotnet nuget push 
  -s github 
  -k ghp_pat 
  NUnit3.DotNetNew.Template_1.7.1.nupkg

Pushing NUnit3.DotNetNew.Template_1.7.1.nupkg to 'https://nuget.pkg.github.com/joshjohanning-org-packages-migrated'...
  PUT https://nuget.pkg.github.com/joshjohanning-org-packages-migrated/
warn : Source owner 'joshjohanning-org-packages-migrated' does not match repo owner 'joshjohanning-org-packages' in repository element.
  BadRequest https://nuget.pkg.github.com/joshjohanning-org-packages-migrated/ 180ms
error: Response status code does not indicate success: 400 (Bad Request).

【讨论】:

    猜你喜欢
    • 2022-08-24
    • 2020-01-13
    • 2021-08-20
    • 2019-09-13
    • 1970-01-01
    • 2019-04-17
    • 2019-06-05
    • 2021-06-20
    • 1970-01-01
    相关资源
    最近更新 更多