.net core Gitlab包注册表每个组获取多个包

.net core Gitlab包注册表每个组获取多个包,.net-core,gitlab,nuget,gitlab-ci,.net Core,Gitlab,Nuget,Gitlab Ci,在我的Gitlab中,我将多个dotnet核心项目(插件)放在名为plugins的组下,在每一个项目中,我都添加了CI步骤,将它们打包到nuget包中,并将它们推送到Gitlab包注册表。我遵循文档:并在.gitlab ci.yaml中放置了以下配置: image: mcr.microsoft.com/dotnet/sdk:5.0 stages: - deploy deploy: stage: deploy script: - dotnet pack -c Release

在我的Gitlab中,我将多个dotnet核心项目(插件)放在名为
plugins
的组下,在每一个项目中,我都添加了
CI
步骤,将它们打包到nuget包中,并将它们推送到Gitlab包注册表。我遵循文档:并在
.gitlab ci.yaml
中放置了以下配置:

image: mcr.microsoft.com/dotnet/sdk:5.0

stages:
  - deploy

deploy:
  stage: deploy
  script:
    - dotnet pack -c Release
    - dotnet nuget add source "$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/packages/nuget/index.json" --name gitlab --username gitlab-ci-token --password $CI_JOB_TOKEN --store-password-in-clear-text
    - dotnet nuget push "bin/Release/*.nupkg" --source gitlab
  only:
    - master
但不是添加项目级源代码(wich正在为我工作)
“$CI\u SERVER\u URL/api/v4/projects/$CI\u project\u ID/packages/nuget/index.json”
我将其替换为组级端点
“$CI_SERVER\u URL/api/v4/groups/{group id}/-/packages/nuget/index.json”
,使用一个用于身份验证的部署令牌,因为我希望该组下的所有项目都有一个源,每次nuget cmd尝试推送包时都会显示此错误

error: ERROR: This version of nuget.exe does not support updating packages to package source my-source

有什么想法吗?

我也遇到了这个。我找到了这个链接


链接中建议的想法是在组中创建一个项目,将所有包推送到该项目。这并不理想,直接推送到小组会更好,但这是一种解决方法,不需要在VisualStudio中使用多个Nuget源。(从2021年2月起,希望将来支持组级推送)

推送到项目级时,源程序包也将显示在组级

但请注意,gitlab在nuget集成方面存在一些基本问题——如果某个人无法访问组中的某个项目,他将无法从该组下载任何软件包。 因此,最好为包创建单独的项目,并在那里推送/使用包