Switch to github pages for documentation

This commit is contained in:
Mathijs van de Nes 2014-10-14 10:59:30 +02:00
parent 4b3b4fda44
commit 61749ebf8e
3 changed files with 34 additions and 6 deletions

View file

@ -7,12 +7,13 @@ notifications:
env:
global:
- secure: F1XhJmZGLE0WuVr7KsN0+Yn5sCiBjc8L9Lwugg5wV3/XwJqskq4EZXSFUDBbhIsMeArMftnrfxejEncySMs/CtjAaHnHxbGvCkWZAihyNQUjbbaYXTpPBfjqye5dhkWIEeTZXfIZacCoFxPGwGA+SWf9PfvgztQyazXEtmxtSqw=
- secure: "VeXvD0tLJyu38t87p8AAztSQVBxsCE1y016l/Nc44203V/RUxj4tz5ifaZcKziPqFHK2ITs2T6fBE1uu404zMVwA0W0J8vmG6+xDoJJLsbwKp4W3SlAI+oIEmFSTIxgzAB7hio17VPDmAqKbnbhbmbP+U94ygoztRNN3ObCZ8yo="
script:
- cargo build
- cargo test
- cargo doc --no-deps
- cargo build
- cargo test
- cargo doc --no-deps
- rustdoc --test README.md -L target
after_script:
- cd target && curl http://www.rust-ci.org/artifacts/put?t=$RUSTCI_TOKEN | sh
- .travis/publish_doc.sh

27
.travis/publish_doc.sh Executable file
View file

@ -0,0 +1,27 @@
#!/bin/bash
if [ "$TRAVIS_BRANCH" = "master" ] &&
[ "$TRAVIS_PULL_REQUEST" = "false" ] &&
[ "$TRAVIS_REPO_SLUG" = "mvdnes/zip-rs" ]
then
echo "Publishing documentation..."
cd $HOME
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/mvdnes/zip-rs gh-pages > /dev/null
cd gh-pages
git config user.email "travis@travis-ci.org"
git config user.name "travis-ci"
git rm -rf . > /dev/null
cp -Rf $TRAVIS_BUILD_DIR/target/doc/* .
git reset HEAD -- index.html > /dev/null
git checkout -- index.html > /dev/null
git add -f .
git commit -m "Auto doc upload from travis"
git push -fq origin gh-pages > /dev/null
echo "Published documentation"
fi

View file

@ -3,7 +3,7 @@ zip-rs
[![Build Status](https://travis-ci.org/mvdnes/zip-rs.svg)](https://travis-ci.org/mvdnes/zip-rs)
[Documentation](http://www.rust-ci.org/mvdnes/zip-rs/doc/zip/)
[Documentation](http://mvdnes.github.io/zip-rs/)
A zip library for rust wich supports reading and writing of simple ZIP files.