通过GitHub工作流管理Azure管道

时间:2020-11-10 09:29:00

标签: azure github pipeline github-actions

在Windows平台上的GitHub操作上,我的构建管道发生了一些无法解释的故障后,我决定仅在Azure devops上迁移此部分。我现在有一个使用以下代码的GitHub工作流程:

- uses: azure/pipelines@v1
  with:
    azure-devops-project-url: 'https://dev.azure.com/organization/project-name'
    azure-pipeline-name: 'pipeline-name' # name of the Azure pipeline to be triggered
    azure-devops-token: '${{ secrets.AZURE_DEVOPS_TOKEN }}'

运行Windows构建和测试。

我现在正在努力地将我的工件检索并上传回GitHub,以便可以将其与Linux和Mac工件一起部署在PyPI上。

我的观点是:

  • 上述任务似乎在启动后立即返回-这很有意义,因为您不想在Azure上运行管道时消耗GitHub资源。然后如何通知完成?
  • 如何实际检索工件?在我这边,我使用了下面的代码段...
  - name: 'Download artifacts from Azure devops build pipeline'
    uses: manishsat/ado-download-artifact@v3
    with:
      buildDefinitionId: 'latest'
      pattoken: ${{ secrets.AZURE_DEVOPS_TOKEN }}
      artifactName: 'wh_windows'
      orgName: 'guillaumealleon'
      projectId: 'scikit-decide'

但这不起作用。第一个latest似乎不是有效的参数-我尝试使用有效的整数,但现在遇到此错误

TypeError

这也与我的观点1相呼应-在执行第二项任务时,我不确定我的工件是否存在。

有什么想法要前进吗?

1 个答案:

答案 0 :(得分:0)

根据以下链接中的DefaultView操作的源代码,您应该使用ado-download-artifact而不是projectId,您可以尝试一下:

https://github.com/manishsat/ado-download-artifact/blob/master/action.yml

projectname