Uploading to CPAN from GitHub


If you have uploaded a distribution to CPAN via Pause recently you may have noticed a link to Mike Schilli's blog where he explains how to publish directly from GitHub.

It only works if your git working copy is structured the same way as the tarball that you want to upload to CPAN. So, if you are making heavy use of MANIFEST.SKIP this probably won't work for you (unless you are also git-ignoring those files). You will also have to ensure that the version number in META.yml in incremented (I've generally rely on ExtUtils::MakeMaker to do this when using make dist).

The only problem that I encountered was that the top level directory in the tarball follows GitHub's conventions rather than the usual module name + version directory created by make dist. So for instance you would get something like /jmcnamara-mymodule-ce15c1e instead of /My-Module-0.01.

Anyway, I uploaded a recent distribution using this method and it worked out well. If you are using GitHub as your repo you should try it.

Leave a comment

About John McNamara

user-pic Just another Perl hacker