diff options
author | Julien Tanguy <julien.tanguy@jhome.fr> | 2015-09-05 02:14:47 +0200 |
---|---|---|
committer | Julien Tanguy <julien.tanguy@jhome.fr> | 2015-09-05 02:14:47 +0200 |
commit | 6f7c6d5a22aec4c237f00bae8f27a3877419537b (patch) | |
tree | 9a619388573bb4238d919014051f9a67b7bc41b0 | |
parent | 3e886a657890184823722fbcbf126bfa4a0f0404 (diff) | |
download | hmacaroons-6f7c6d5a22aec4c237f00bae8f27a3877419537b.tar.gz hmacaroons-6f7c6d5a22aec4c237f00bae8f27a3877419537b.tar.zst hmacaroons-6f7c6d5a22aec4c237f00bae8f27a3877419537b.zip |
Make travis push haddock to gh-pages
-rw-r--r-- | .travis.yml | 16 | ||||
-rw-r--r-- | scripts/pushdoc.sh | 24 |
2 files changed, 37 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index f0ecd95..6d0e226 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -2,6 +2,8 @@ | |||
2 | language: c | 2 | language: c |
3 | sudo: false | 3 | sudo: false |
4 | 4 | ||
5 | |||
6 | |||
5 | cache: | 7 | cache: |
6 | directories: | 8 | directories: |
7 | - $HOME/.cabsnap | 9 | - $HOME/.cabsnap |
@@ -16,10 +18,14 @@ matrix: | |||
16 | - env: CABALVER=1.18 GHCVER=7.8.4 | 18 | - env: CABALVER=1.18 GHCVER=7.8.4 |
17 | compiler: ": #GHC 7.8.4" | 19 | compiler: ": #GHC 7.8.4" |
18 | addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}} | 20 | addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}} |
19 | - env: CABALVER=1.22 GHCVER=7.10.1 | 21 | - env: CABALVER=1.22 GHCVER=7.10.2 |
20 | compiler: ": #GHC 7.10.1" | 22 | compiler: ": #GHC 7.10.2" |
21 | addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1], sources: [hvr-ghc]}} | 23 | addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}} |
22 | 24 | ||
25 | env: | ||
26 | global: | ||
27 | - GH_REF: github.com/jtanguy/hmacaroons.git | ||
28 | - secure: "ITyaZaTiQFOUQFN24wFWuo5sYuVJg6UQSJd28NpGdCJS9NOMk2ijZfDpY05+dug9TacmiALZ5Lt3Xlcx0pJSRkpYbG0AaB1k/52/D2LtOF13fDPAxHNbfvBRiUS4hk2LBl3SQFimYoTRNA/ssXvgjwehTB4ytkPgkLZu3rODin8=" | ||
23 | 29 | ||
24 | before_install: | 30 | before_install: |
25 | - unset CC | 31 | - unset CC |
@@ -71,10 +77,14 @@ script: | |||
71 | - cabal check | 77 | - cabal check |
72 | - cabal sdist # tests that a source-distribution can be generated | 78 | - cabal sdist # tests that a source-distribution can be generated |
73 | 79 | ||
80 | - bash ./scripts/pushdoc.sh | ||
81 | |||
74 | # Check that the resulting source distribution can be built & installed. | 82 | # Check that the resulting source distribution can be built & installed. |
75 | # If there are no other `.tar.gz` files in `dist`, this can be even simpler: | 83 | # If there are no other `.tar.gz` files in `dist`, this can be even simpler: |
76 | # `cabal install --force-reinstalls dist/*-*.tar.gz` | 84 | # `cabal install --force-reinstalls dist/*-*.tar.gz` |
77 | - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && | 85 | - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && |
78 | (cd dist && cabal install --force-reinstalls "$SRC_TGZ") | 86 | (cd dist && cabal install --force-reinstalls "$SRC_TGZ") |
79 | 87 | ||
88 | |||
89 | |||
80 | # EOF | 90 | # EOF |
diff --git a/scripts/pushdoc.sh b/scripts/pushdoc.sh new file mode 100644 index 0000000..ddab752 --- /dev/null +++ b/scripts/pushdoc.sh | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/bash | ||
2 | set -e # exit with nonzero exit code if anything fails | ||
3 | |||
4 | cabal haddock | ||
5 | |||
6 | pushd dist/doc/html/hmacaroons | ||
7 | git init | ||
8 | |||
9 | # inside this git repo we'll pretend to be a new user | ||
10 | git config user.name "Travis CI" | ||
11 | git config user.email "julien.tanguy@jhome.fr" | ||
12 | |||
13 | # The first and only commit to this new Git repo contains all the | ||
14 | # files present with the commit message "Deploy to GitHub Pages". | ||
15 | git add . | ||
16 | git commit -m "Deploy to GitHub Pages" | ||
17 | |||
18 | # Force push from the current repo's master branch to the remote | ||
19 | # repo's gh-pages branch. (All previous history on the gh-pages branch | ||
20 | # will be lost, since we are overwriting it.) We redirect any output to | ||
21 | # /dev/null to hide any sensitive credential data that might otherwise be exposed. | ||
22 | git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1 | ||
23 | |||
24 | popd | ||