I was trying to use new Build on Visual Studio Team Services (not XAML) but couldn't figure out how to label the source upon successful build. Any idea?
Below is the screenshot that shows how to do in XAML one.
I already have a feature request at https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/9613014-allow-label-source-upon-succesful-build-on-visual I'm actually asking for a workaround until Microsoft implements it.
The Label Sources feature is unavailable in vNext build.
Besides the Label Sources feature, the Associate Work Items and Create Work Item on Build Failure features are unavailable as well.
You can submit one feature request about it on the Microsoft UserVoice site: https://visualstudio.uservoice.com/forums/121579-visual-studio/category/30925-team-foundation-server-visual-studio-online
The XAML build did label sources at the start of the build, while vNext build seems to label at the end of the build. I noticed that, because I modify/checkin/label files during the build. If I let vNext label the build, it moves the label that I have applied to the files after checkin to the previous version (the version that was used in GetSources).
But I did not see the labeling of vNext in any logfile. Did I miss it? I will have to disable labeling in vnext and do it in my msbuild script...
edit: Disabled labeling in vnext build definition and created an msbuild inline task to label the sources of the workspace. Now I can label all sources at the start of the build and move the label for files that were modified during the build :)
If someone wants to do something similiar, here is my inline task:
For those of you running across this thread looking for a solution to TFS hosted (not VSO), note that support for build labels came out in TFS 2015 Update 1: https://www.visualstudio.com/en-us/news/tfs2015-update1-vs.aspx
We're not running Update 1 yet, so I can't confirm.
Edit: We're now running Update 1 (and 2, actually), and label build sources works for on-prem.
I just noticed that the feature is now available in build vNext. Its configuration is in the Repository tab in the build definition.
I think Yves Dierick's answer was correct back in October 2015, but the layout of the VSTS screens has changed a lot since then. In the latest version (as of February 2017), you can add a label to a successful build by selecting the Get Sources task in the Build Definition, choosing show Advanced Settings in the top-right corner and then selecting the On success radio button under the Tag Sources section that appears.
Took me a while to find it, so I thought it might help someone else. It doesn't help that this option is under "Tag sources" and doesn't mention the word "label" at all.
Update 13/03/2018
They've tweaked the layout of this page again, but made it simpler if anything, and now the option is more helpfully named "Label Sources".