azure - 请参阅使用 YAML 管道在 Azure DevOps 中构建工件

标签 azure azure-devops

我好像漏掉了一些东西。使用经典编辑器创建构建管道时,我可以在右上角看到一个工件选项卡:

enter image description here

在那里我可以浏览编译器创建的内容,帮助找出发布管道的文件夹结构。

现在,当我使用 YAML 模板(也是 NET Framework)创建构建管道时,不存在工件这样的东西:

enter image description here

根据日志,一些文件已被写入。是否有某种文件浏览器,或者我必须猜测 these variables 中的哪一个与日志文件中的哪个文件夹匹配?

这就是我的摘要页面的样子: enter image description here

这是 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://learn.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: ArchiveFiles@2
  inputs:
    rootFolderOrFile: '$(Build.BinariesDirectory)'
    includeRootFolder: false
    archiveType: 'zip'
    archiveFile: '$(Build.ArtifactStagingDirectory)/Release.zip'
    replaceExistingArchive: true

我使用的 YAML 主要是从 Github 存储库构建时生成的标准 YAML。这会影响我是否可以看到文物吗?我应该先将 Github 内容复制到 Azure 然后再构建它吗?

最佳答案

更新:我发现了问题: GitHub Builds 的默认 YAML 文件不包含“发布”步骤。将其添加到构建 YAML 的末尾后

- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'drop'
    publishLocation: 'Container'

它实际上创建了“Artifacts”选项卡: enter image description here

感谢大家的帮助

关于azure - 请参阅使用 YAML 管道在 Azure DevOps 中构建工件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59863163/

相关文章:

c# - 无法在 Windows Phone 8.1 Silverlight 上使用 WNS 发送推送通知

azure - 如何向 Terraform 中的 Azure Devops 项目授予 "Storage Blob Data Contributor"权限?

azure-devops - 错误 : More than one package matched with specified pattern Azure Function Release Pipeline in Azure DevOps

azure - 如何在 Azure DevOps 发布管道中连接 azaaccount

azure - 如何将构建或发布属性传递给 Azure 函数

azure - 使用 microsoft graph api 授予向所选广告组添加/删除成员的权限

wordpress - 显示 IP 地址而不是域名

javascript - 如何从Azure移动应用服务调用HTTP(Azure Functions)?

c# - Azure devops - 在 netcore/模板项目之外找不到 NUnit 测试

c# - 使用 Azure AD 客户端凭据授予流程的 Azure Devops Access