Utility: Publish Build Artifacts

Last Update: 9/26/2016

Team Services | TFS 2015 Update 3 | TFS 2015 RTM | Previous versions (XAML builds)

Publish Build artifacts to the server or a file share.




Argument Description
Path to Publish

Path to the folder or file you want to publish. The path must be a fully qualified path or a valid path relative to the root directory of your repo.

A common way to use this build step is to specify $(Build.ArtifactStagingDirectory) as the Target Folder of the Copy Files step step, and then also specify that variable for this argument.

Artifact Name Specify the name of the artifact. For example: drop
Artifact Type

Choose server to store the artifact on your Team Foundation Server. This is the best and simplest option in most cases.

Choose file share to copy the artifact to a file share. Some common reasons to do this:

  • The size of your drop is large and consumes too much time and bandwidth to copy.
  • You need to run some custom scripts or other tools against the artifact.

If you use a file share, specify the UNC file path to the folder. You can control how the folder is created for each build using variables. For example \\my\share\$(Build.DefinitionName)\$(Build.BuildNumber).

Note: You cannot use a file share if you are using the hosted pool.

Control options

Clear this check box if you want to disable a step. This is a handy option if a step is not working correctly or if you need to focus on other parts of the process.

Tip: You can also right-click the build step to toggle this setting.

Continue on error

If an error occurs in this step, and this check box is:

  • Cleared: The build fails and no subsequent steps are run.
  • Selected: The build will be partially successful at best, and the next step is run.
Always run Select this check box if you want the step to run even if the build is failing.
Timeout The timeout for this task in minutes. The default is zero (infinite timeout).

Q & A

Q: I'm having problems. How can I troubleshoot them?

A: Try this:

  1. On the variables tab, add system.debug and set it to true. Select to allow at queue time.

  2. In the explorer tab, view your completed build and click the build step to view its output.

The control options arguments described above can also be useful when you're trying to isolate a problem.

Q: How do variables work? What variables are available for me to use in the arguments?

A: $(Build.SourcesDirectory) and $(Agent.BuildDirectory) are just a few of the variables you can use. See Variables.