This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-website.git

commit 1acdea2be083611ce85801fa95cd365711add592
Author: Swatantra Yadav <[email protected]>
AuthorDate: Thu Oct 8 13:57:18 2026 +0530

    ci: upgrade GitHub Actions to Node.js 24 runtime
    
    Resolve #190. GitHub Actions Node.js 20 is deprecated and will be removed
    from runners. The ubuntu-latest label will also migrate to Ubuntu 26.
    
    This upgrade bumps:
    - actions/checkout from v6 to v7
    - actions/setup-python from v4 to v7
    - actions/upload-artifact from v5 to v7
    - Python from 3.8 to 3.10
    
    Also ensures compatibility for legacy Sphinx 4.x releases (e.g., NuttX 
12.0.0)
    by pinning sphinxcontrib extension versions when building older releases.
    
    Signed-off-by: Swatantra Yadav <[email protected]>
---
 .github/workflows/main.yml | 93 ++++++++++++++++++++--------------------------
 1 file changed, 40 insertions(+), 53 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9091786e48..9a4090a7ce 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -9,128 +9,115 @@ on:
     branches:
       - master
   schedule:
-    - cron: '0 0 * * *' 
+    - cron: '0 0 * * *'
+
+permissions:
+  contents: write
 
 jobs:
   build:
     runs-on: ubuntu-latest
     steps:
     - name: Checkout Site
-      uses: actions/checkout@v6
-    - run: |
-        git fetch --prune --unshallow
+      uses: actions/checkout@v7
+      with:
+        fetch-depth: 0
 
     - name: Checkout NuttX repo
-      uses: actions/checkout@v6
+      uses: actions/checkout@v7
       with:
         repository: apache/nuttx
         fetch-depth: 0
         ref: master
         path: nuttx
-    - uses: actions/setup-python@v4
+
+    - uses: actions/setup-python@v7
       with:
-        python-version: '3.8'
+        python-version: '3.10'   # EOL Oct 2026; test 3.12 before switching
+
     - name: Build docs
+      env:
+        PIPENV_VERBOSITY: -1
+        PIPENV_IGNORE_VIRTUALENVS: 1   # one isolated env per NuttX release
       run: |
         echo "======================================================="
         echo " Install Pipenv"
         echo "======================================================="
-
         python3 -m venv .venv
         source .venv/bin/activate
-        export PIPENV_VERBOSITY=-1
         pip3 install pipenv
-        
+
         echo "======================================================="
         echo " Install PlantUML"
         echo "======================================================="
-
-        sudo apt update
-        sudo apt install plantuml
+        sudo apt-get update
+        sudo apt-get install -y plantuml
 
         echo "======================================================="
         echo " Setup nuttx/Documentation"
         echo "======================================================="
-
         cd nuttx/Documentation
         DOCDIR=../../docs
         rm -rf $DOCDIR
 
-        echo "======================================================="
-        echo " Select nuttx/Documentation version candidates"
-        echo "======================================================="
-
-        NUTTX_TAGS=$(git tag -l --sort=taggerdate 'nuttx-1?.*' | fgrep -v RC)
+        NUTTX_TAGS=$(git tag -l --sort=taggerdate 'nuttx-1?.*' | grep -Fv RC)
         export NUTTX_VERSIONS=$(echo -n "$NUTTX_TAGS" | sed -r 's|^nuttx-||g' 
| tr '\n' ',')
-        
         echo " ==> BUILD NUTTX DOCUMENTATION FOR: $NUTTX_VERSIONS (and 
master)."
 
         for nuttx_version in $NUTTX_TAGS master; do
-
           echo " ===> BUILDING DOCUMENTATION FOR NuttX $nuttx_version."
-
           git checkout -f $nuttx_version
 
-          # NuttX uses Sphinx as documentation generator. Sphinx needs Python.
-          # Sphinx may have different dependencies for different NuttX release.
-          # Manage Python packages with PipEnv per release deinfed in Pipfile.
           echo " ====> PIPENV INSTALL."
-
           pipenv install
+          pipenv run python -c "import sphinx; print(sphinx.__version__)" 
2>/dev/null | grep -q '^4\.' && pipenv run pip install 
"sphinxcontrib-applehelp==1.0.4" "sphinxcontrib-devhelp==1.0.2" 
"sphinxcontrib-htmlhelp==2.0.1" "sphinxcontrib-qthelp==1.0.3" 
"sphinxcontrib-serializinghtml==1.1.5" || true
 
           if [ "$nuttx_version" = "master" ]; then
             OUTDIR="$DOCDIR/latest"
           else
             OUTDIR="$DOCDIR/${nuttx_version#nuttx-}"
           fi
-
           echo " ====> OUTDIR IS: $OUTDIR."
 
-          echo " ====> STARTING SPHINX BUILD."
-
-          pipenv run make html BUILDDIR="$OUTDIR"
-
-          echo " ====> COPY RESULTS."
-
-          mv $OUTDIR/html/* $OUTDIR
-
-          echo " ====> BUILD LOCATION CLEANUP."
-
-          rm -rf $OUTDIR/{html,doctrees}
+          if pipenv run make html BUILDDIR="$OUTDIR"; then
+            mv $OUTDIR/html/* $OUTDIR
+            rm -rf $OUTDIR/{html,doctrees}
+          else
+            if [ "$nuttx_version" = "master" ]; then
+              echo "::error::Docs build failed for master"
+              exit 1
+            fi
+            echo "::warning::Docs build failed for $nuttx_version, skipping"
+            rm -rf "$OUTDIR"
+          fi
 
           echo " ====> PIPENV CLEANUP."
-
-          # Clear caches (pipenv, pip)
-          pipenv --clear install
-
+          pipenv --rm || true
         done
 
         cd ../..
-
-        echo  " ========== DOCUMENTATION BUILD FINISHED ==========="
-
+        echo " ========== DOCUMENTATION BUILD FINISHED ==========="
 
     - name: Install Ruby tools
-      run: |
-        sudo apt-get -y install rubygems ruby-dev zlib1g-dev
+      run: sudo apt-get install -y rubygems ruby-dev zlib1g-dev
 
     - name: Build Site
       run: |
         export GEM_HOME=$HOME/.gem
         export PATH=$PATH:$GEM_HOME/bin
-        username="`git log -1 --pretty=format:'%an'`"
-        email="`git log -1 --pretty=format:'%ae'`"
+        username="$(git log -1 --pretty=format:'%an')"
+        email="$(git log -1 --pretty=format:'%ae')"
         git config --global user.name "$username"
         git config --global user.email "$email"
         ./publish.sh
 
     - name: Upload artifact of staged site
-      uses: actions/upload-artifact@v5
+      uses: actions/upload-artifact@v7
       with:
         name: static-site
         path: content
+        include-hidden-files: true
 
     - name: Publish Site
-      if: (github.event_name == 'push' || github.event_name == 
'repository_dispatch' || github.event_name == 'workflow_dispatch' || 
github.event_name == 'schedule' ) && github.ref == 'refs/heads/master'
-      run: |
-        git push origin asf-site:asf-site
+      if: (github.event_name == 'push' || github.event_name == 
'repository_dispatch' || github.event_name == 'workflow_dispatch' || 
github.event_name == 'schedule') && github.ref == 'refs/heads/master'
+      run: git push origin asf-site:asf-site

Reply via email to