I would get the assembly version as described in the following posts:
MSBuild Task to read version of dll
Access Version from AssemblyInfo in MSBuild
As follows[Altered version of the code as described in the given links]:
<PropertyGroup>
<AssemblyList>myfolder\myLibrary.dll</AssemblyList>
</PropertyGroup>
<Target Name="AssemblyInformations">
<GetAssemblyIdentity
AssemblyFiles="$(AssemblyList)">
<Output
TaskParameter="Assemblies"
ItemName="AssemblyInfos"/>
</GetAssemblyIdentity>
<Message Text="Files: %(AssemblyInfos.Version)"/>
And then I would use something like the following to create a directory in the place you want to publish:
<CreateProperty Value="$(Public_Shared_Folder)$(ProjectName)\">
<Output TaskParameter="Value" PropertyName="PublicFolderToDropZip" />
</CreateProperty>
<MakeDir Directories="$(PublicFolderToDropZip)" Condition="$(Configuration)=='Release' And !Exists('$(PublicFolderToDropZip)')" />
The entire operation can be completely automated.