diff --git a/.github/workflows/linux.build.yml b/.github/workflows/linux.build.yml index 045e2a87047..5e55591e9a9 100644 --- a/.github/workflows/linux.build.yml +++ b/.github/workflows/linux.build.yml @@ -1,4 +1,4 @@ -name: CI +name: Linux CI # Controls when the action will run. on: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3dce0ae315a..af8fc6f89f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,21 +1,12 @@ -name: CI +name: Doxygen # Controls when the action will run. on: push: branches: 'master' - # Run for all pull requests - pull_request: - branches: '*' - types: [opened] - env: - CMAKE_DOXYGEN_INPUT_LIST: "Components Docs/src OgreMain PlugIns RenderSystems" - OGRE_SOURCE_DIR: "./" - OGRE_BINARY_DIR: "./" OGRE_VERSION: "latest" - DOXYGEN_HTML_OUTPUT_DIR: "./latest" # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -24,27 +15,15 @@ jobs: # The type of runner that the job will run on runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - - uses: actions/checkout@v3 - - - name: Generate Doxyfile - # Replace CMake's ${ENV_VAR} to Doxygen's $(ENV_VAR) syntax - run: cat CMake/Templates/html.cfg.in | sed 's/\${\(.*\)}/$(\1)/' > Doxyfile - - - name: Generate docs with doxygen - uses: mattnotmitt/doxygen-action@v1 - with: - doxyfile-path: './Doxyfile' - - - name: Remove files - working-directory: .github/workflows/ - run: python3 doxygen_remove_files.py - - - name: Publish # Only on master branch - if: github.ref == 'refs/heads/master' - uses: peaceiris/actions-gh-pages@v3 + - uses: actions/checkout@v4 + - name: Build Doxygen + working-directory: ./ + run: ./Scripts/BuildScripts/build_ci_doxygen_step0.sh + - uses: actions/checkout@v4 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./ - keep_files: true + ref: gh-pages + path: gh-pages + - name: Publish Doxygen + working-directory: ./ + run: ./Scripts/BuildScripts/build_ci_doxygen_step1.sh diff --git a/Scripts/BuildScripts/build_ci_doxygen_step0.sh b/Scripts/BuildScripts/build_ci_doxygen_step0.sh new file mode 100755 index 00000000000..e5992bad88f --- /dev/null +++ b/Scripts/BuildScripts/build_ci_doxygen_step0.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +if [ -z "$OGRE_VERSION" ]; then + echo "OGRE_VERSION is not set. Aborting!" + exit 1; +fi + +echo "--- Installing System Dependencies ---" +sudo apt-get update +sudo apt-get install -y ninja-build libxrandr-dev libxaw7-dev libxcb-randr0-dev libx11-xcb-dev libsdl2-dev doxygen graphviz + +echo "--- Fetching prebuilt Dependencies ---" +wget https://github.com/OGRECave/ogre-next-deps/releases/download/bin-releases/Dependencies_Release_Ubuntu.20.04.LTS.Clang-12_a3f61e782f3effbd58a15727885cbd85cd1b342b.7z + +echo "--- Extracting prebuilt Dependencies ---" +7z x Dependencies_Release_Ubuntu.20.04.LTS.Clang-12_a3f61e782f3effbd58a15727885cbd85cd1b342b.7z + +mkdir -p build/Doxygen +cd build/Doxygen +echo "--- Building Ogre (Debug) ---" +cmake \ +-DOGRE_CONFIG_THREAD_PROVIDER=0 \ +-DOGRE_CONFIG_THREADS=0 \ +-DOGRE_BUILD_COMPONENT_SCENE_FORMAT=1 \ +-DOGRE_BUILD_SAMPLES2=0 \ +-DOGRE_BUILD_TESTS=0 \ +-DOGRE_BUILD_COMPONENT_PLANAR_REFLECTIONS=1 \ +-DCMAKE_BUILD_TYPE="Debug" \ +-DCMAKE_CXX_STANDARD=11 \ +-G Ninja ../.. || exit $? +ninja OgreDoc || exit $? +cd ../.. || exit $? +# echo "--- Checking out gh-pages branch ---" +# git checkout gh-pages || exit $? + +echo "Done Step 0!" diff --git a/Scripts/BuildScripts/build_ci_doxygen_step1.sh b/Scripts/BuildScripts/build_ci_doxygen_step1.sh new file mode 100755 index 00000000000..2ea1d481233 --- /dev/null +++ b/Scripts/BuildScripts/build_ci_doxygen_step1.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +if [ -z "$OGRE_VERSION" ]; then + echo "OGRE_VERSION is not set. Aborting!" + exit 1; +fi + +# echo "--- Checking out gh-pages branch ---" +# git checkout gh-pages || exit $? +cd gh-pages || exit $? +cd api || exit $? +echo "--- Removing old ${OGRE_VERSION} ---" +git rm -rf ${OGRE_VERSION} || exit $? +rm -rf ${OGRE_VERSION} || exit $? +echo "--- Copying new ${OGRE_VERSION} ---" +mv ../../build/Doxygen/api/html ${OGRE_VERSION} || exit $? +echo "--- Adding to ${OGRE_VERSION} to git ---" +git add ${OGRE_VERSION} || exit $? +echo "--- Committing ---" +git commit -m "Deploy GH" || exit $? +echo "--- Pushing repo... ---" +git push || exit $? + +echo "Done Step 1!"