Skip to content
Permalink
Browse files

Build manual on Travis and push to gh-pages

  • Loading branch information...
kernc committed Dec 19, 2017
1 parent 5fe8ce1 commit 896d71f6796fe4bacf1bd1ea35d35df227597726
Showing with 29 additions and 2 deletions.
  1. +5 −0 .travis.yml
  2. +22 −0 .travis/man2html.sh
  3. +2 −2 CMakeLists.txt
@@ -17,11 +17,13 @@ addons:
- cppcheck
- libwnck-3-dev
- libglib2.0-dev
- groff

before_install:
- set -e
- pip install --user cpplint
- ./lint.sh
- "! groff -wall -mandoc -Thtml doc/xsuspender.1 |& grep ' warning: '"

install:
- cd build
@@ -32,3 +34,6 @@ install:

script:
- xvfb-run make test

after_success:
- if [ "$GH_PASSWORD" ] && [ $CC = "gcc" ]; then cd ..; .travis/man2html.sh; fi
@@ -0,0 +1,22 @@
#!/bin/bash

# If man had changed, rebuild its HTML and push to gh-pages

set -e

[ "$TRAVIS" = true ] || exit 0
[ "$TRAVIS_PULL_REQUEST" = false ] || exit 0
[ "$GH_PASSWORD" ] || exit 12

parent=$(git show --pretty=raw HEAD | awk '/^parent /{ print $2; exit }')
head=$(git rev-parse HEAD)

if ! git diff --name-only "$parent" "$head" | grep -Pq "doc/.*\.[1-8]$"; then
exit 0
fi

git clone -b gh-pages --depth 3 "https://kernc:$GH_PASSWORD@github.com/$TRAVIS_REPO_SLUG.git" gh-pages
groff -wall -mandoc -Thtml doc/xsuspender.1 > gh-pages/xsuspender.1.html
cd gh-pages
git commit -m "CI: Update xsuspender.1.html from $head" -- xsuspender.1.html
git push
@@ -24,8 +24,8 @@ install (FILES data/${PROJECT_NAME}.conf
DESTINATION ${example_dir})
install (FILES data/${PROJECT_NAME}.desktop
DESTINATION etc/xdg/autostart)
install (FILES man/${PROJECT_NAME}.1
DESTINATION man/man1)
install (FILES doc/${PROJECT_NAME}.1
DESTINATION share/man/man1)

add_subdirectory (src)

0 comments on commit 896d71f

Please sign in to comment.
You can’t perform that action at this time.