Wednesday, December 3, 2008

Hosting LuaRocks Repositories at GitHub

GitHub has recently started supporting clean URLs for raw file access. The old, cluttered kind of raw URLs looked like this:
http://github.com/elemel/rocks/tree/master/import-0.1-1.rockspec?raw=true
The new, clean kind looks like this:
http://github.com/elemel/rocks/raw/master/import-0.1-1.rockspec
The new kind of URL allows you to host LuaRocks repositories at GitHub. Mine is at:
http://github.com/elemel/rocks/raw/master
To create your own LuaRocks repository at GitHub, follow these steps:
  1. Create a GitHub repository named e.g. rocks and change directory to your local clone of it.
  2. Copy your rockspec files to your working directory.
  3. Make a manifest: luarocks-admin make_manifest .
  4. Stage (add), commit, and push your rockspec files and manifest to GitHub.
  5. Add the raw URL string for your repository to the rocks_servers array in your config.lua file.
The tarball and zipball URLs of GitHub are convenient in rockspec files. For an example, see the rockspec file for import referred above. If you have trouble browsing a repository, try appending a slash to the URL.

Update: I have moved my LuaRocks repository to my GitHub Pages.

No comments: