@@ -0,0 +1,22 @@
1+#!/bin/bash
2+
3+# Run this script in the top-level of your package directory
4+# (where the .cabal file is) to compile documentation and
5+# upload it to hackage.
6+
7+# Requirements:
8+# cabal-install-1.24 (for --for-hackage)
9+# haddock 2.17 (for the hyperlinked source)
10+
11+set -e
12+
13+VERSION=`grep "^version:" docker.cabal | cut -d " " -f14`
14+BUILDDIR=dist-newstyle/build/docker-$VERSION
15+DOCSDIRNAME=docker-$VERSION-docs
16+
17+cabal act-as-setup -- haddock --builddir=$BUILDDIR --for-hackage --hyperlink-sources
18+cd $BUILDDIR/doc/html && tar --format=ustar -zcvf $DOCSDIRNAME.tar.gz $DOCSDIRNAME
19+
20+echo NOW RUN: \n\n
21+echo cabal upload -d $BUILDDIR/doc/html/$DOCSDIRNAME.tar.gz
22+