แชร์ผ่าน


PublishBuildArtifacts@1 - Publish build artifacts v1 task

Use this task in a build pipeline to publish build artifacts to Azure Pipelines, TFS, or a file share.

Inputs

PathtoPublish - Path to publish
string. Required.

Specifies the folder or file path to publish. This can be a fully qualified path or a path relative to the root of the repository. Wildcards are not supported. Variables are supported. Example: $(Build.ArtifactStagingDirectory). For more information, see Artifacts in pipelines - overview.


ArtifactName - Artifact name
string. Required.

Specifies the name of the artifact to create in the publish location.


publishLocation - Artifact publish location
Input alias: ArtifactType. string. Required. Allowed values: Container (Visual Studio Team Services/TFS), FilePath (A file share).

Specifies whether to store the artifact in Azure Pipelines (Container), or to copy it to a file share (FilePath) that must be accessible from the build agent. For more information, see Artifacts in Azure Pipelines.


TargetPath - File share path
string. Optional. Use when ArtifactType = FilePath. Default value: \\my\share\$(Build.DefinitionName)\$(Build.BuildNumber).

Specifies the path to the file share where you want to copy the files. The path must be a fully qualified path or a valid path relative to the root directory of your repository. Publishing artifacts from a Linux or macOS agent to a file share is not supported. Example: \\my\share\$(Build.DefinitionName)\$(Build.BuildNumber).


Parallel - Parallel copy
boolean. Optional. Use when ArtifactType = FilePath. Default value: false.

Specifies whether to copy files in parallel using multiple threads for greater potential throughput. If this setting is not enabled, a single thread will be used.


ParallelCount - Parallel count
string. Optional. Use when ArtifactType = FilePath && Parallel = true. Default value: 8.

Specifies the degree of parallelism (the number of threads) used to perform the copy. The value must be at least 1 and not greater than 128. Choose a value based on CPU capabilities of the build agent.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Remarks

Note

You cannot use Bin, App_Data and other folder names reserved by IIS as an Artifact name because this content is not served in response to Web requests. Please see ASP.NET Web Project Folder Structure for more details.

Examples

steps:
- task: CopyFiles@2
  inputs:
    contents: '_buildOutput/**'
    targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
  inputs:
    pathToPublish: $(Build.ArtifactStagingDirectory)
    artifactName: MyBuildOutputs

Requirements

Requirement Description
Pipeline types YAML, Classic build
Runs on Agent, DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 1.91.0 or greater
Task category Utility

See also