Publishing a module to the Orchard Gallery

The steps involved in publishing a module to the Orchard Gallery, as documented, are somewhat out of date as trying to follow them didn’t match reality, unfortunately. As I’ve just gone through the process of publishing a module, I’m documenting the steps involved in the process so that (a) when/if I publish another module I can follow them, (b) others might find this and have an easier time of it than I did, and (c) once I’ve got the steps documented here, I can look at updating the Orchard documentation itself so that it reflects what’s actually there (i.e. my blog will be a first draft!)

The main steps are:

  1. Package up your module using orchard.exe
  2. Register for an account at https://gallery.orchardproject.net/ – this appears to be substantially the same (UI changes aside) as the steps in the Orchard documentation
  3. Host the package somewhere (it doesn't appear as if you can upload the package to the gallery itself anymore)
  4. Create a Package in the Gallery
  5. Create a Package Version in the Gallery

I'm going to break each of the steps out into a separate headed section, though for the most part some of them will be the same as the existing documentation.

Package up your module using orchard.exe

The steps for this are the same as those documented in Packaging and Sharing a module:

  1. Run orchard.exe
  2. Execute the command package create NameOfPackage LocationToCreatePackage
    e.g. package create RW.Orchard.Conditions C:\Repositories\Binaries\
  3. Glory in the fact that you've packaged your Orchard module

Register for an account at https://gallery.orchardproject.net

The steps for this are, again, basically the same as those documented in the Orchard docs, but the screenshots are a bit different:

  1. Navigate to http://gallery.orchardproject.net/
  2. Click "Sign In" at the top-right of the page
  3. Click the "Register" link (or jump straight to https://gallery.orchardproject.net/Users/Account/Register)
  4. Fill in the required fields and click "Register"
  5. Wait for the email to arrive that contains an account activation link
  6. Click the link to activate your account and then login to confirm that your account is working

Host the package somewhere

For this, it looks like the old version of the gallery supported uploading packages to it, whereas the new version doesn't. For the sake of simplicity, I went down the route of tagging my project on GitHub, cutting a release and uploading the NuGet package I created in "Package up your module using orchard.exe" as a binary attached to the release. For the sake of completness, I'll list the steps I followed here, so if you're hosting the code for your module on GitHub, this is certainly a route you can follow:

  1. Go to GitHub and tag your repository with the same version number that you've put into the module definition (it doesn't have to be the same, but don't confuse matters unless you really need to!)
  2. Create a release, associated with the tag and attach the .nupkg file (in my case "Orchard.Module.RW.Orchard.Conditions.1.0.1.nupkg" that you created to the release

Hey presto, you've now got the package binary hosted and ready to be associated with a Package Version. The URL, in my example is https://github.com/robertwray/RW.Orchard.Conditions/releases/download/1.0.1/Orchard.Module.RW.Orchard.Conditions.1.0.1.nupkg 

Create a Package in the Gallery

The overall "intent" of the instructions for creating a package in the existing documentation matches what you have to do, but the process is tweaked slightly and now looks like this:

  1. Login to the Orchard Gallery
  2. Click on your name at the top-right to bring up the menu and click "Dashboard" (yes, the gallery is Orchard based!)
  3. Click "Package" under "New" in the menu sidebar to the left
  4. Fill in *all* the fields
    1. Pay attention to the "Package Id" field, I'm fairly sure that this needs to match the package you've created (in my case: RW.Orchard.Conditions)
    2. Fill in the rest of the fields with sensible/useful information for people that are going to be looking for your package - you can come back and edit this later
  5. Click "Save"

Congratulations, you've created your package. You may have noticed that there was nowhere to plug in the URL of the package that you stored earlier, this comes when you create a Package Version.

Create a Package Version in the Gallery

Now you've created your package, you need to create a Package Version so that people can actually download it (and so that you can create new versions when you add features or fix bugs):

  1. Repeat the first two steps for creating a package (login and go to /Admin)
  2. Click "Package Version" under "New" in the menu sidebar to the left
  3. Fill in all the fields
    1. Write-up some release notes into the "Body" field
    2. Make sure the correct package is selected (if you've created more than one)
    3. Enter the version number (e.g. 1.0.1)
    4. Drop the package URL into the "Package Url" field
  4. Click "Save"
  5. Frantically login to an Orchard instance you own and search "Modules" for your newly created module

Step 5 is slightly facetious, but it does work - the moment you click "Save" your module is available for others to load into their Orchard instances, so do try to make sure the module actually works =)

It looks like a lot of steps (a screen full of text here!), but that's because I've been very detailed, it probably takes no more than about 5 or 10 minutes to go from .csproj to module available from the Orchard Gallery. Famous last words, but it surely wouldn't take more than 6 to 8 weeks to bake this into orchard.exe.....?

About Rob

I've been interested in computing since the day my Dad purchased his first business PC (an Amstrad PC 1640 for anyone interested) which introduced me to MS-DOS batch programming and BASIC.

My skillset has matured somewhat since then, which you'll probably see from the posts here. You can read a bit more about me on the about page of the site, or check out some of the other posts on my areas of interest.

No Comments

Add a Comment