我有2种方法可以在Azure DevOps上构建管道,可以使用YAML管道模板,也可以使用经典编辑器中预设的任务(也可以将其转换为任务组)。如果我以任何一种方式选择相同的模板,则其YAML管道模板副本中的经典编辑器中可能会缺少相同的任务。
我同时选择了.NET桌面。https://i.imgur.com/2fGcZ14.png
[在经典编辑器中,我可以看到其中两个发布任务,如下所示。https://i.imgur.com/yxYxD44.png
尽管使用YAML管道,上面看到的2个任务丢失了。
# .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)'
我不知道为什么会这样。在此感谢一些帮助或指示,谢谢。
这两项任务都没有丢失,但是您可能需要手动添加它们。
发布工件不再是一个独立的任务,它已成为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