From 492763205ba2b4dddcf40102f2ac4f75b3c952f2 Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Thu, 29 Mar 2018 14:26:45 +0100 Subject: [PATCH 1/3] introduced docs auto publish step to travisci --- .travis.yml | 11 ++++++++++- Makefile | 1 + util/deployGHP.sh | 23 +++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 util/deployGHP.sh diff --git a/.travis.yml b/.travis.yml index 938b01f5..792e942c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,19 @@ language: c os: - - osx - linux + - osx compiler: - gcc - clang env: - WREN_OPTIONS="" CI_ARCHS="ci_32 ci_64" - WREN_OPTIONS="-DWREN_NAN_TAGGING=0" CI_ARCHS="ci_64" + +jobs: + include: + - stage: deploy + script: bash util/deployGHP.sh + # Travis VMs are 64-bit but we compile both for 32 and 64 bit. To enable the # 32-bit builds to work, we need gcc-multilib. addons: @@ -15,5 +21,8 @@ addons: packages: - gcc-multilib - g++-multilib + - python3-markdown + - ruby-sass + sudo: false # Enable container-based builds. script: make WREN_CFLAGS=${WREN_OPTIONS} ${CI_ARCHS} diff --git a/Makefile b/Makefile index f952c283..21791bdc 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,7 @@ benchmark: release # Generate the Wren site. docs: + mkdir -p build $(V) ./util/generate_docs.py # Continuously generate and serve the Wren site. diff --git a/util/deployGHP.sh b/util/deployGHP.sh new file mode 100644 index 00000000..54ecb01a --- /dev/null +++ b/util/deployGHP.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +make gh-pages + +git clone https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG} gh-pages-repo +cd gh-pages-repo +git checkout gh-pages + +rm -rf * +cp -r ../build/gh-pages/* . + +git status +ls + +if ! $( git diff-index --quiet HEAD ) ; then + git config user.name "Travis CI" + git config user.email "$COMMIT_AUTHOR_EMAIL" + git add -A . + git commit -m "Deploy to GitHub Pages: ${SHA}" + git push +fi From f7a61df634d32b7ef8e5202b98071c3ee8ba0229 Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Fri, 6 Apr 2018 19:53:53 +0100 Subject: [PATCH 2/3] only upload docs from the master branch --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 792e942c..4905b166 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ jobs: include: - stage: deploy script: bash util/deployGHP.sh + if: branch = master # Travis VMs are 64-bit but we compile both for 32 and 64 bit. To enable the # 32-bit builds to work, we need gcc-multilib. From 67ed36e79a565e45ace7725c871a5d9231e116e0 Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Fri, 6 Apr 2018 20:04:34 +0100 Subject: [PATCH 3/3] don't publish docs from PRs, only from merges into master --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4905b166..6e206c80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ jobs: include: - stage: deploy script: bash util/deployGHP.sh - if: branch = master + if: branch = master AND NOT type IN (pull_request) # Travis VMs are 64-bit but we compile both for 32 and 64 bit. To enable the # 32-bit builds to work, we need gcc-multilib.