Skip to content

Commit

Permalink
Split docs publish up into scripts, add new tag to index on publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo157 committed Dec 29, 2014
1 parent d8c38ee commit 1e89a2a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 10 deletions.
11 changes: 2 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,5 @@ deploy:

after_deploy:
- cargo publish --token $CRATES_IO_TOKEN
- echo "machine github.com login $GITHUB_TOKEN password x-oauth-basic" >> ~/.netrc
- chmod 0600 ~/.netrc
- git remote add github https://github.com/$TRAVIS_REPO_SLUG.git
- git fetch github gh-pages
- git checkout -b gh-pages FETCH_HEAD
- mv target/doc docs/$TRAVIS_TAG
- git add docs/$TRAVIS_TAG
- git commit -m "Add API docs for $TRAVIS_TAG"
- git push github gh-pages:gh-pages
- ./save_credentials.sh $GITHUB_TOKEN
- ./publish_docs.sh $TRAVIS_TAG
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[package]

name = "roaring"
version = "0.0.8"
version = "0.0.9"
authors = ["Wim Looman <ghostunderscore@gmail.com>"]
description = "http://roaringbitmap.org for http://www.rust-lang.org"

documentation = "https://nemo157.github.io/roaring-rs"
homepage = "https://github.com/Nemo157/roaring-rs"
repository = "https://github.com/Nemo157/roaring-rs"

Expand Down
26 changes: 26 additions & 0 deletions publish_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

set -e

: ${TRAVIS:?'This should only be run on Travis CI'}
TAG=${1:?'Must provide tag'}

# Setup this repo to publish the docs
git fetch origin gh-pages
git checkout gh-pages

# Move the built docs into versioned folder
mv target/doc docs/$TAG

# Update the index to point to the versioned docs
sed -i '' -e '/<!-- DOCS INDEX -->/i\
<li><a href="docs/'"$TAG"'/roaring/">'"$TAG"'</a></li>' \
index.html

# Add the changes
git add docs/$TAG
git add index.html

# Commit and push
git commit -m "Add API docs for $TAG"
git push
9 changes: 9 additions & 0 deletions save_credentials.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

set -e

: ${TRAVIS:?'This should only be run on Travis CI'}
GITHUB_TOKEN=${1:?'Must provide github token'}

echo "machine github.com login $GITHUB_TOKEN password x-oauth-basic" >> ~/.netrc
chmod 0600 ~/.netrc

0 comments on commit 1e89a2a

Please sign in to comment.