Artefacts. How to prepare as you want

Packing & Uploading - Artefacts

About different Environments

Firstly, it doesn't matter where the planned use this script. It can be unified for all environments.

It means you should see the same result as for your PC with Visual Studio (for example) and same for X Build Server (CI):

Artefacts on PC

Read first:

Releases from a few projects

Full example you can see in our project: Full script for assembling the vsSolutionBuildEvent v0.12.6 (actual version in current script file)

As result you will see this files (i.e. only for example - your variants can be as you want) for deploy or for simple use.


File Description
bin\Releases\CI.MSBuild_v1.5_[df66438][net40].zip Packed binaries from 'CI.MSBuild' project.
bin\Releases\Devenv_v1.3_[df66438][net40].zip Packed binaries from 'Devenv' project.
bin\Releases\Provider_v3.0_[df66438][net40].zip Packed binaries from 'Provider' project.
bin\Releases\Release_notes.txt Auto-generated notes from current assemblies.
bin\Releases\vsSBE.CI.MSBuild.1.5.1206.nupkg NuGet package from 'CI.MSBuild' project.
bin\Releases\vsSolutionBuildEvent_v0.12.6.5585_[df66438][net40].vsix VSPackage of main project.


This assembled from:

* Configuration:   'CI_Debug' (Folders: Debug)
* .NET version:     v4.0;
* MSBuild Tools:    v12.0;
* Build number:     5585;
* Branch Sha1:      df66438;
* Branch Name:      master;
* Branch revCount:  323;


* The 'Bridge':                 v1.3;
* The 'CI.MSBuild':             v1.5;
* The 'Devenv':                 v1.3;
* The 'Provider':               v3.0;
* The 'vsSolutionBuildEvent':   v0.12.6.5585;


* NuGet 'vsSBE.CI.MSBuild': v1.5.1206;


* ClientDemo - [df66438][net40](5585)

         Generated by vsSolutionBuildEvent

How to

Please note, you can achieve this result with different modes.

Firstly, you need to decide how will be numbered the versions of all your projects (means the format). It can be as here or other.

Available components of SBE-Scripts: Official list. Or use other mode !

Ok, now we're ready:

  • Select event type - "Post-Build".
  • Change "Processing mode" to 'Script Mode'
  • Add action & Activate SBE-Scripts support

The final script can be like this:

  • Packing - 'Bridge'
#[7z pack.files({ 
#[( $(Configuration) ~= "Release" ) { 
            "$(pDirBridge)bin\$(cfg)\Release_notes.txt" }, "$(odir)Bridge_v$(numBridge)_[$(branchSha1)][$(netStamp)].zip")]
  • Packing - 'Devenv'
#[var _DP = $(SolutionDir)$(pDirDevenv)bin\#[var cfg]\]

#[IO"$(_DP)Devenv", true)]
#[IO"", "$(_DP)Devenv", true)]

#[IO copy.file({
               "$(_DP)Devenv\\", true, {"Devenv.AddIn"})]

#[( #[IO exists.file("$(_DP)Extensibility.dll")] ) {
    #[IO copy.file("$(_DP)Extensibility.dll", "$(_DP)\Devenv\\", true)]

#[IO copy.file("$(odir)\Release_notes.txt", "$(_DP)Devenv\\", true)]
#[7z pack.files({"$(_DP)Devenv.AddIn", "$(_DP)Devenv\*.*"}, "$(odir)Devenv_v$(numDevenv)_[$(branchSha1)][$(netStamp)].zip")]
  • Rename vsix
#[IO copy.file(
  • NuGet Packing - 'vsSBE.CI.MSBuild'
#[var tplNuspec = #[File get("vsSBE.CI.MSBuild.nuspec.tpl")]]
#[var nupCIMdir = $(odir)NuGet-CI.MSBuild-package]

#[IO"$(nupCIMdir)", true)]
#[IO"", "$(nupCIMdir)", true)]

#[var nuspec = $(tplNuspec.Replace("%CIM%", "$(numCIM)").Replace("%Lib%", "$(libCoreInt)").Replace("%vsSBE%", "$(numSBE)"))]
#[File write("$(nupCIMdir)\vsSBE.CI.MSBuild.nuspec"):#[var nuspec]]

#[" files for package "]

#[IO copy.file("$(CIMLib)\*.dll", "$(nupCIMdir)\bin\\", true)]#[" CIMLib custom "]

#[" vsix dir "]
#[IO copy.file({
               "$(nupCIMdir)\bin\\", true)]

#[NuGet gnt.raw("gnt.core /t:pack /p:ngin=\"$(nupCIMdir)\" /p:ngout=\"$(odir)\"")]
#[IO"$(nupCIMdir)", true)]

Where - 'vsSBE.CI.MSBuild.nuspec.tpl' the is a template e.g.:

<?xml version="1.0"?>
<package >
    <title>vsSolutionBuildEvent CI.MSBuild</title>
    <releaseNotes>Updated the vsSolutionBuildEvent library: v%vsSBEVersion%</releaseNotes>
  • For 'Release_notes.txt', use simply:
#[File write("$(odir)\Release_notes.txt"):

* The 'Bridge': #[$(numBridge)]
* NuGet 'vsSBE.CI.MSBuild': v#[var numCIM].#[var libCoreInt];

As result:

  • All packages should appear in bin\Release folder.
    • You also should ignore this folder in your scm (.gitignore, .hgignore, .bzrignore, svn:ignore, etc.,)

Working example you can see in:

Remote servers