From 6af9a0b9abd0047272c74da11fb85e2ab4449f57 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Tue, 28 Jul 2020 13:56:59 -0400 Subject: [PATCH] Move dox build to GitHub actions --- .github/workflows/ci-suite.yml | 44 ++++++++++++++++++++++++++++++++++ .travis.yml | 23 ------------------ build/build_dox.sh | 43 --------------------------------- 3 files changed, 44 insertions(+), 66 deletions(-) delete mode 100644 .travis.yml delete mode 100755 build/build_dox.sh diff --git a/.github/workflows/ci-suite.yml b/.github/workflows/ci-suite.yml index e2e0fa100b..db1d6fdf0b 100644 --- a/.github/workflows/ci-suite.yml +++ b/.github/workflows/ci-suite.yml @@ -66,6 +66,50 @@ jobs: fi exit $retval + dox-build: + name: Build Doxygen Site + runs-on: ubuntu-latest + env: + DOXDIR: ~/tgsdox + steps: + - name: Install Graphviz + run: apt-get install graphviz + + - name: Checkout + uses: actions/checkout@v1 + + - name: Patch Doxyfile + run: | + VERSION=$(cat "build/Version.props" | grep -oPm1 "(?<=)[^<]+") + echo -e "\nPROJECT_NUMBER = $VERSION\nINPUT = .\nOUTPUT_DIRECTORY = $DOXDIR\nPROJECT_LOGO = ./build/tgs.ico\nHAVE_DOT=YES" >> "docs/Doxyfile" + + - name: Prep gh-pages Repository + if: github.event_name == 'push' && github.ref == 'dev' + run: | + git clone -b gh-pages --single-branch "https://git@github.com/tgstation/tgstation-server" "$DOXDIR" + rm -r "$DOXDIR/*" + + - name: Doxygen Build + uses: mattnotmitt/doxygen-action@v1 + with: + doxyfile-path: 'docs/Doxyfile' + + - name: gh-pages push + if: github.event_name == 'push' && github.ref == 'dev' + run: | + cd $DOXDIR + git config --global push.default simple + git config user.name "tgstation-server" + git config user.email "tgstation-server@tgstation13.org" + echo '# THIS BRANCH IS AUTO GENERATED BY GITHUB ACTIONS' > README.md + + # Need to create a .nojekyll file to allow filenames starting with an underscore + # to be seen on the gh-pages site. Therefore creating an empty .nojekyll file. + echo "" > .nojekyll + git add --all + git commit -m "Deploy code docs to GitHub Pages for Travis build $TRAVIS_BUILD_NUMBER" -m "Commit: $TRAVIS_COMMIT" + git push -f "https://${{ secrets.GITHUB_TOKEN }}}@$GITHUB_URL" 2>&1 | /dev/null + docker-build: name: Build Docker Image runs-on: ubuntu-latest diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 333ddccbe2..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -os: linux -dist: xenial -language: generic -git: - depth: 1 - -branches: - only: - - dev - - master - -jobs: - include: - - env: - name: "Dox Generation" - addons: - apt: - packages: - - doxygen - - graphviz - -script: - - build/build_dox.sh diff --git a/build/build_dox.sh b/build/build_dox.sh deleted file mode 100755 index 9703274177..0000000000 --- a/build/build_dox.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -BUILD_FOLDER=$TRAVIS_BUILD_DIR - -DOXDIR=~/tgsdox - -mkdir -p $DOXDIR - -if [ "$TRAVIS_PULL_REQUEST" = false ] && [ "$TRAVIS_BRANCH" = "master" ]; then - PUBLISH_DOX=true -else - PUBLISH_DOX=false -fi - -if [ "$PUBLISH_DOX" = true ] ; then - GITHUB_URL="github.com/$TRAVIS_REPO_SLUG" - echo "Cloning https://git@$GITHUB_URL..." - git clone -b gh-pages --single-branch "https://git@$GITHUB_URL" "$DOXDIR" 2> /dev/null - rm -r "$DOXDIR/*" -fi - -VERSION=$(cat "build/Version.props" | grep -oPm1 "(?<=)[^<]+") - -echo -e "\nPROJECT_NUMBER = $VERSION\nINPUT = $BUILD_FOLDER\nOUTPUT_DIRECTORY = $DOXDIR\nPROJECT_LOGO = $BUILD_FOLDER/build/tgs.ico\nHAVE_DOT=YES" >> "$BUILD_FOLDER/docs/Doxyfile" - -doxygen "$BUILD_FOLDER/docs/Doxyfile" - -if [ "$PUBLISH_DOX" = true ] ; then - cd $DOXDIR - git config --global push.default simple - git config user.name "tgstation-server" - git config user.email "tgstation-server@tgstation13.org" - echo '# THIS BRANCH IS AUTO GENERATED BY TRAVIS CI' > README.md - - # Need to create a .nojekyll file to allow filenames starting with an underscore - # to be seen on the gh-pages site. Therefore creating an empty .nojekyll file. - echo "" > .nojekyll - git add --all - git commit -m "Deploy code docs to GitHub Pages for Travis build $TRAVIS_BUILD_NUMBER" -m "Commit: $TRAVIS_COMMIT" - git push -f "https://$TGS4_GH_PAGES_TOKEN@$GITHUB_URL" 2>&1 | /dev/null - cd "$BUILD_FOLDER" - rm -rf "$DOXDIR/.git" -fi