pythonazure-devopsazure-pipelinesazure-reposazure-releases

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


I’m using Azure DevOps and I’m trying to package my python code into a .ZIP file. I’m also using Azure for my repo for my python folder.

Here’s my folder in my repo

Here’s my YAML code for my pipeline

Everything works fine, my only issue is that the .ZIP folder that gets published is completely empty and I want it to be my python file


Solution

  • By default, the source code files will be checked out to the directory "Build.SourcesDirectory" on the agent machine. The artifact files output from the build also are in this directory.

    By default, the directory "Build.ArtifactStagingDirectory" is empty, the source code files and build artifact files will not be automatically added/generated into this directory.

    Before archive a ZIP file from the directory "Build.ArtifactStagingDirectory", you should use the Copy Files task to copy the files which you want to archive from the directory "Build.SourcesDirectory" into the directory "Build.ArtifactStagingDirectory".

    For more details, you can see view this document.

    enter image description here

    enter image description here