From 200d7153caf1c051f54becebda8d9a7257a8a66e Mon Sep 17 00:00:00 2001 From: redtide Date: Mon, 2 Dec 2019 02:35:58 +0100 Subject: [PATCH] Automated Doxygen documentation with Travis-CI --- .editorconfig | 2 +- .gitignore | 4 ++++ .travis.yml | 7 +++++-- .travis/after_success.sh | 11 ----------- .travis/{after_failure.sh => discord_webhook.sh} | 2 +- .travis/update_dox.sh | 13 +++++++++++++ Doxyfile | 6 +++--- 7 files changed, 27 insertions(+), 18 deletions(-) delete mode 100755 .travis/after_success.sh rename .travis/{after_failure.sh => discord_webhook.sh} (82%) create mode 100755 .travis/update_dox.sh diff --git a/.editorconfig b/.editorconfig index ea67a2e5..cee094a7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,6 +13,6 @@ indent_style = space insert_final_newline = true trim_trailing_whitespace = true -[*.{ttl,ttl.in}] +[*.{ttl,ttl.in,yml}] indent_size = 2 indent_style = space diff --git a/.gitignore b/.gitignore index 546356a7..c6bae06c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,10 +19,14 @@ clients/sfizz_jack clients/sfzprint # gh-pages unstaged files: +_api/ _site/ .bundle/ api/ assets/ node_modules/ +.jekyll-cache +.jekyll-metadata +.sass-cache *.lock *.sublime-* diff --git a/.travis.yml b/.travis.yml index 12988993..4ffd2b6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ matrix: packages: - gcc-8 - g++-8 + - doxygen env: - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" @@ -27,10 +28,12 @@ script: - sh ${TRAVIS_BUILD_DIR}/.travis/script.sh after_failure: -- sh ${TRAVIS_BUILD_DIR}/.travis/after_failure.sh +- sh ${TRAVIS_BUILD_DIR}/.travis/discord_webhook.sh failure after_success: -- sh ${TRAVIS_BUILD_DIR}/.travis/after_success.sh +- sh ${TRAVIS_BUILD_DIR}/.travis/discord_webhook.sh success +- sh ${TRAVIS_BUILD_DIR}/.travis/update_dox.sh +- sh ${TRAVIS_BUILD_DIR}/.travis/deploy.sh deploy: provider: releases diff --git a/.travis/after_success.sh b/.travis/after_success.sh deleted file mode 100755 index d9dafabc..00000000 --- a/.travis/after_success.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -# Travis Webhook -wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh -chmod +x send.sh -./send.sh success $WEBHOOK_URL - -# Deploy -./deploy.sh diff --git a/.travis/after_failure.sh b/.travis/discord_webhook.sh similarity index 82% rename from .travis/after_failure.sh rename to .travis/discord_webhook.sh index 1345855f..8ab1ee30 100755 --- a/.travis/after_failure.sh +++ b/.travis/discord_webhook.sh @@ -5,4 +5,4 @@ set -e # Travis Webhook wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh chmod +x send.sh -./send.sh failure $WEBHOOK_URL +./send.sh ${1} ${WEBHOOK_URL} diff --git a/.travis/update_dox.sh b/.travis/update_dox.sh new file mode 100755 index 00000000..af2d1679 --- /dev/null +++ b/.travis/update_dox.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +doxygen Doxyfile +git fetch --depth=1 https://github.com/${TRAVIS_REPO_SLUG}.git refs/heads/gh-pages:refs/remotes/origin/gh-pages +git checkout origin/gh-pages +git checkout -b gh-pages +rm -rf ./api +mv _api api +git add api && git commit -m "Travis build: ${TRAVIS_BUILD_NUMBER}" +git remote add origin-pages https://${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git > /dev/null 2>&1 +git push --quiet --set-upstream origin-pages gh-pages diff --git a/Doxyfile b/Doxyfile index e130133c..1de7cecd 100644 --- a/Doxyfile +++ b/Doxyfile @@ -820,8 +820,8 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = sfizz \ - doxygen/pages +INPUT = doxygen/pages \ + src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -1105,7 +1105,7 @@ GENERATE_HTML = YES # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_OUTPUT = api +HTML_OUTPUT = _api # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp).