Publish Pipeline Artifacts task
Use this task in a pipeline to publish your artifacts(note that publishing is NOT supported in release pipelines. It is supported in multi-stage pipelines, build pipelines, and yaml pipelines).
Looking to get started with build artifacts? See Artifacts in Azure Pipelines.
# Publish pipeline artifacts # Publish (upload) a file or directory as a named artifact for the current run - task: PublishPipelineArtifact@1 inputs: #targetPath: '$(Pipeline.Workspace)' # Required #artifactName: 'drop' # Optional #artifactType: 'pipeline' # Required. Options: pipeline, filepath. Default value: pipeline #fileSharePath: '\server\folderName' # Required when artifactType = filepath #parallel: false # Optional. Default value: false #parallelCount: 1 # Optional. Value must be at least 1 and not greater than 128. Default value: 8
download keywords are shortcuts for the Publish Pipeline Artifact task. You can use them in your pipeline to publish and download artifacts. For more information, see Publish and Download in the YAML schema.
|targetPath||(Required) Path to the folder or file you want to publish. Wildcards are not supported. The path must be a fully-qualified path or a valid path relative to the root directory of your repository. See Artifacts in Azure Pipelines.|
|artifactName||(Optional) Specify the name of the artifact that you want to create. It can be whatever you want. For example:
|artifactType||(Required) Artifacts publish location. Choose whether to publish your file as a pipeline artifact, or to copy it to a file share that must be accessible from the pipeline agent. Options: pipeline, filepath. Default value: pipeline|
|fileSharePath||(Optional) The file share path that the artifact will be published to. This can include variables. Required when
|parallel||(Optional) Select whether to copy files in parallel using multiple threads. If this setting is not enabled, one thread will be used. Default value: false|
|parallelCount||(Optional) Enter the degree of parallelism, or number of threads used to publish a package. The value must be at least 1 and not greater than 128.|
Q: I'm having issues with publishing my artifacts. How can I view the detailed logs?
To enable detailed logs for your pipeline:
- Edit your pipeline and select Variables
- Add a new variable with the name
Q: Which variables are available to me?
$(Agent.BuildDirectory) are just few of the variables you can use in your pipeline. Variables are available as expressions or scripts.
Q: Task allows me to publish artifacts in deployment job in yaml pipeline, but I am not able to use it in downstream pipeline?
A: Deployment jobs do not have the context of source branches and are hence not appropriate for publishing artifacts. They have been primarily designed to consume artifacts. A workaround would be to isolate that logic into a separate job (with dependencies on your deployment jobs).
This task is open source on GitHub. Feedback and contributions are welcome.