如何从 dist 文件夹中的 azure-pipelines 下载使用 gulp 脚本构建的工件

How to download artifacts built with gulp script in azure-pipelines from dist folder

我正在构建一个电子应用程序,它使用 gulp 脚本来构建应用程序并将最终的 .exe|.deb|.dmg 文件放在 {root}/dist/desktop 目录中。我如何下载这些文件。我在天蓝色中没有看到任何 'Artifacts' 部分。

这是我的 azure-pipelines.yml,构建良好。

variables:
  node_version: "10.x"

trigger:
  - master

jobs:
  - job: Windows
    pool:
      vmImage: "vs2017-win2016"
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: $(node_version)
      - script: yarn install
      - script: yarn build:desktop-azure

  - job: macOS
    pool:
      vmImage: "macOS-10.14"
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: $(node_version)
      - script: yarn install
      - script: yarn build:desktop-azure

  - job: Linux
    pool:
      vmImage: "ubuntu-16.04"
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: $(node_version)
      - script: yarn install
      - script: yarn build:desktop-azure

您需要在每个作业中添加一个 Publish Build Artifacts Task,此任务会将文件保存在 Azure DevOps 中,您将能够下载它们(也可以在 Release 中获取它们):

- task: PublishBuildArtifacts@1
  inputs:
     pathtoPublish: 'path/to/the/dist/desktop/folder'
     artifactName: 'windows/mac/linux-artifacts'