在Azure DevOps中,与相同的YAML管道模板相比,经典编辑器模板中的任务丢失

我有两种方法可以在Azure DevOps上构建管道,使用YAML管道模板或在Classic Editor中预设的任务(也可以将其转换为任务组)。 如果我以上述任何一种方式选择相同的模板,则其经典编辑器中的YAML管道模板对应对象可能会缺少相同的任务。

我同时选择了.NET桌面。 https://i.imgur.com/2fGcZ14.png

在Classic Editor中,我可以看到其中两个发布任务,如下所示。 https://i.imgur.com/yxYxD44.png

使用YAML管道,尽管缺少上述两个任务。

# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols,save build artifacts,and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net

trigger:
- master

pool:
  vmImage: 'windows-latest'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: Nugetcommand@2
  inputs:
    restoreSolution: '$(solution)'

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

- task: VSTest@2
  inputs:
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

我不知道为什么会这样。在此先感谢一些帮助或指点。

FWBOOO 回答:在Azure DevOps中,与相同的YAML管道模板相比,经典编辑器模板中的任务丢失

这两项任务都没有丢失,但是您可能需要手动添加它们。

发布工件不再是一项独立的任务,它已成为YAML管道核心功能的一部分,因此它是有效的本地步骤publish

steps:
- publish: output/files # path to files/directory containing files you want to publish
  artifact: myartifact # Name of the artifact

对于复制文件,这仍然是一项任务,as documented here

The docs for YAML pipelines are pretty good IMO

还有complete reference for the all the built-in tasks

本文链接:https://www.f2er.com/3138635.html

大家都在问