From 2e53e9db02533993b5bf616c5a45854288a33b99 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sun, 4 Jan 2026 11:12:28 +0800 Subject: [PATCH] doxygen doc are too big for pages, use R2 --- .doxygen | 6 ++++- .github/workflows/doxygen-docs.yml | 43 +++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/.doxygen b/.doxygen index eda965cc73..d557f6ba85 100644 --- a/.doxygen +++ b/.doxygen @@ -1059,7 +1059,11 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = */deps/* +EXCLUDE_PATTERNS = */build/* +EXCLUDE_PATTERNS = */deps_src/* + + # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the diff --git a/.github/workflows/doxygen-docs.yml b/.github/workflows/doxygen-docs.yml index e95ba6d5e5..f30c3e0d0e 100644 --- a/.github/workflows/doxygen-docs.yml +++ b/.github/workflows/doxygen-docs.yml @@ -13,25 +13,30 @@ jobs: build-and-deploy: name: Build and Deploy Docs runs-on: ubuntu-latest + timeout-minutes: 60 # Only run on main branch of the main repository if: github.repository == 'OrcaSlicer/OrcaSlicer' && github.ref == 'refs/heads/main' + permissions: + contents: read steps: - uses: thejerrybao/setup-swap-space@v1 with: swap-space-path: /swapfile swap-size-gb: 8 remove-existing-swap-files: true - + - name: Checkout repository uses: actions/checkout@v6 - name: Install Doxygen and Graphviz run: | + set -euo pipefail sudo apt-get update sudo apt-get install -y doxygen graphviz - name: Generate documentation run: | + set -euo pipefail # Override DOT_NUM_THREADS to avoid parallel dot race condition bug sed -i 's/^DOT_NUM_THREADS.*/DOT_NUM_THREADS = 1/' .doxygen doxygen .doxygen @@ -40,10 +45,34 @@ jobs: echo "Error: Documentation generation failed - index.html not found" exit 1 fi + - name: Install Rclone + run: | + set -euo pipefail + sudo -v + curl -fsSL https://rclone.org/install.sh | sudo bash - - name: Deploy to Cloudflare Pages - uses: cloudflare/wrangler-action@v3 - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy internal_docs --project-name=orcaslicer-internals + - name: optimize + run: | + set -euo pipefail + rm -f internal_docs/Nodes.xml internal_docs/Tokens.xml + find internal_docs -name "*.map" -type f -delete || true + find internal_docs -name "*.md5" -type f -delete || true + + - name: upload + # We configure rclone dynamically using environment variables + run: | + set -euo pipefail + # Remove existing config if it exists to avoid conflicts + rclone config delete cloudflare 2>/dev/null || true + rclone config create cloudflare s3 \ + provider Cloudflare \ + access_key_id ${{ secrets.R2_ACCESS_KEY_ID }} \ + secret_access_key ${{ secrets.R2_SECRET_ACCESS_KEY }} \ + endpoint ${{ secrets.R2_ENDPOINT }} + + rclone sync internal_docs/ cloudflare:orcaslicer-internals \ + --progress \ + --transfers 512 \ + --checkers 512 + + echo "Documentation upload completed successfully" \ No newline at end of file