Aug 16, 2014

Producing a new release for a Drupal.org contrib module

I recently produced my first release of the Optimizely module for Drupal.org. There are several steps involved, which I am documenting here in a brief overview of the process specifically for Drupal.org.

The sources listed below give a lot more of the details.

I am assuming that you're familiar with the basic concepts and commands for using git to clone a repo, make commits, manage branches, etc.

(0)  Create a release branch within your development repo that will contain your work. You may be using an existing branch, in which case you don't need to do this.

The required convention for naming branches for contrib modules looks like these examples.

  7.x-3.x
  8.x-2.x

The first part, before the hyphen, refers to the major version of Drupal core. The second part refers to the major version of the module you're working on.

Exact version numbers for specific releases are provided in a separate step by doing a git tag.

N.B. On Drupal.org, we are told not to use the master branch.

(1)  When the code in your dev repo is ready for release, git push the branch to the repo on Drupal.org.

(2)  In your dev repo, git tag with a tag such as the following.

  7.x-3.5-alpha3
  8.x-2.14-beta1
  7.x-1.0

The recognized suffixes are:  unstable  alpha  beta  rc
These must be lowercase, and there must be a number appended to the suffix if you use one.

  $  git  tag  8.x-2.14-beta1

After tagging the code in the dev branch, git push the tag to Drupal.org.

  $  git  push  origin  8.x-2.14-beta1

(3)  On the module's page on Drupal.org, go to Edit > Releases. Click on Add new release to create a new release.

(4)  Finally, on Edit > Releases, check Show snapshot release if you want the release to appear on the module's front page in the list of releases. You may not need to do this if it's been done before for the branch you're working on.

It may take a minute or two for the new release to show up on the site.


Sources:

On the Version control tab of a module's page on Drupal.org there are excellent instructions that include actual commands to use. For example, 
https://www.drupal.org/node/1305958/git-instructions/8.x-2.x

Creating and testing full projects and releases
https://www.drupal.org/node/1015224

Release naming conventions
https://www.drupal.org/node/1015226

Creating a project release
https://www.drupal.org/node/1068944


1 comment:

  1. Perhaps add examples of the actual git commands in each spot where you discuss them. An example:

    "Create a release branch within your development repo..."
    $ git checkout -b 8.x-2.14-beta1

    ReplyDelete