I will explain how to use a Build Activity to zip, by customizing LabDefaultTemplate.11.xaml.
How to add a custom code activity to a build template is clearly explained in this article http://www.ewaldhofman.nl/post/2010/04/29/Customize-Team-Build-2010-e28093-Part-4-Create-your-own-activity.aspx
Go through the above article if you want to know the basics.
So lets look at how to add a build activity to zip the build output.
1. First you need to have a code activity similar to below
2. Once compiled and add reference to your build template project you can view the New Activity --> Zip in the Toolbox when you open the build template.
3. Drag and drop the Zip activity to LabDefaultTemplate.11.xaml after the "Compute build location needed" activity to make sure BuildLocation variable is filled with the correct build location (This variable will contain the Build Folder path of the Build queued or used by the Build task of the Lab Workflow).
4. Set the properties as below in the Zip build activity. DirectoryLocation is set to Build Location and Zip file path will be Build Location path with ".zip" extension. This will make sure zip file is created at the drop location of the build used by the lab workflow.
5. Create a build definition using the lab template and set the lab workflow build step to use the release build definition of yours (Output of this build will be used to create the zip file).
6. Queue a build with the lab build and you will see lab(build-deploy-test) build, queues the release build, once complete use the build location and create the build output as a zip file.
7. In the drop location of the release build you will have the build out put files and the zip file of the output.