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:
- Package up your module using orchard.exe
- 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
- Host the package somewhere (it doesn't appear as if you can upload the package to the gallery itself anymore)
- Create a Package in the Gallery
- 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:
- Run orchard.exe
- Execute the command package create NameOfPackage LocationToCreatePackage
e.g. package create RW.Orchard.Conditions C:\Repositories\Binaries\
- 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:
- Navigate to http://gallery.orchardproject.net/
- Click "Sign In" at the top-right of the page
- Click the "Register" link (or jump straight to https://gallery.orchardproject.net/Users/Account/Register)
- Fill in the required fields and click "Register"
- Wait for the email to arrive that contains an account activation link
- 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:
- 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!)
- 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:
- Login to the Orchard Gallery
- Click on your name at the top-right to bring up the menu and click "Dashboard" (yes, the gallery is Orchard based!)
- Click "Package" under "New" in the menu sidebar to the left
- Fill in *all* the fields
- 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)
- 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
- 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):
- Repeat the first two steps for creating a package (login and go to /Admin)
- Click "Package Version" under "New" in the menu sidebar to the left
- Fill in all the fields
- Write-up some release notes into the "Body" field
- Make sure the correct package is selected (if you've created more than one)
- Enter the version number (e.g. 1.0.1)
- Drop the package URL into the "Package Url" field
- Click "Save"
- 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.....?
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.