Generate NuGet packages for Sitecore releases via PowerShell

Context

I’ve been working a lot on Sitecore development infrastructure recently and package management is one of the areas, particularly NuGet.

Unfortunately, Sitecore doesn’t provide any feed that you could use right away. so carrying over Sitecore DLLs in a repository is a standard practice that I’ve seen for few years and actually been using.

So I decided to create my own packages and here how I did it.

Versioning

My goal was to create versioned packages for every version starting from 8.0. Once I started I found out that versioning of DLL and installation ZIP – two things not related one to each other. Major versions of DLLs were not in sync with release numbers. And I’m not even talking about update number, which is not there in any form.

After few attempts to use Sitecore DLL version, I gave up and come up with my own: MAJOR_VERSION.MINOR_VERSION.UPDATE.REVISION_DATE.

This structure is simple and intuitive. You don’t need to remember that update 3 to version 8.0 was released on Apr 27th, 2015.

Also, I’ve made following simplification – everything that is coming from one installation ZIP would have one version.

Generation

Generation has a few steps described in a PowerShell script:

  • find DLLs starting with Sitecore in website/bin folder;
  • generate version and description based on version;
  • go with Reflection into an assembly and detect dependencies to other Sitecore libraries;
  • detect the assembly framework and generate .nuspec file
  • generate NuGet package and push into your feed

Results

Once packages are generated and pushed to a NuGet repository we have the following picture. Enjoy!

2016-08-05_0133


Follow me on twitter @true_shoorik. Would be glad to discuss ideas above in comments.

Link

3 thoughts on “Generate NuGet packages for Sitecore releases via PowerShell

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s