我正在尝试使用YAML使用.Net Core CLI还原,生成,打包和推送Azure DevOps。
还原对内部Feed有所了解,但打包却不知道。
如何将内部Feed添加到打包操作中?
parameters:
projects: ''
steps:
- task: DotNetCoreCLI@2
displayName: "ProvisionRestoreProjects"
inputs:
command: 'restore'
projects: '${{ parameters.projects }}'
feedsToUse: 'select'
vstsFeed: '/4d73414a-a21f-4f84-9355-90beadaf0a6e'
- task: DotNetCoreCLI@2
displayName: "ProvisionBuildProjects"
inputs:
command: 'build'
projects: ${{ parameters.projects }}
arguments: '--configuration release --no-cache'
- task: DotNetCoreCLI@2
displayName: "ProvisionPackProjects"
inputs:
command: 'pack'
projects: ${{ parameters.projects }}
versioningScheme: 'byEnvVar'
versionEnvVar: 'NugetVersion'
feedsToUse: 'select'
vstsFeed: '/4d73414a-a21f-4f84-9355-90beadaf0a6e'
- task: DotNetCoreCLI@2
displayName: "ProvisionPushProjects"
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
feedsToUse: 'select'
vstsFeed: '/4d73414a-a21f-4f84-9355-90beadaf0a6e'
答案 0 :(得分:1)
答案 1 :(得分:1)
pack
命令“ builds the project and creates NuGet packages”,这就是为什么它试图再次还原软件包。
为防止这种情况,请在任务输入中添加nobuild: true
:
- task: @DotNetCoreCLI@2
displayName: Pack
inputs:
command: pack
nobuild: true
它将不再尝试重建项目本身,而是使用先前步骤中创建的工件。