当我尝试通过 YAML 将我的 python 代码打包成 .ZIP 时,该文件夹是空的

When I try to package my python code into a .ZIP through YAML, the folder is empty

我正在使用 Azure DevOps,我正在尝试将我的 python 代码打包到一个 .ZIP 文件中。我还在为我的 python 文件夹使用 Azure。

Here’s my folder in my repo

Here’s my YAML code for my pipeline

一切正常,我唯一的问题是发布的 .ZIP 文件夹完全是空的,我希望它成为我的 python 文件

默认情况下,源代码文件将被检出到代理计算机上的目录“Build.SourcesDirectory”。构建输出的工件文件也在此目录中。

默认情况下,目录“Build.ArtifactStagingDirectory”为空,源代码文件和构建工件文件不会自动added/generated进入该目录.

从目录“Build.ArtifactStagingDirectory”归档 ZIP 文件之前,您应该使用 Copy Files task 复制您要从中归档的文件目录“Build.SourcesDirectory”进入目录“Build.ArtifactStagingDirectory”.

更多详情可以查看this document.