From f03a23cebe1821525846d88bca0a01206f53593d Mon Sep 17 00:00:00 2001 From: Vaclav Petras Date: Thu, 20 Feb 2025 00:03:44 -0500 Subject: [PATCH] Get addons according to the version (breaks for major version transitions when addons branch may not exist), rebuild keywords, rename file --- .../{mkdocs.yml => documentation.yml} | 47 +++++++++++++------ 1 file changed, 33 insertions(+), 14 deletions(-) rename .github/workflows/{mkdocs.yml => documentation.yml} (77%) diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/documentation.yml similarity index 77% rename from .github/workflows/mkdocs.yml rename to .github/workflows/documentation.yml index 4e9682e281b..e884082db28 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/documentation.yml @@ -1,7 +1,7 @@ --- name: Documentation -# Build documentation +# Builds Markdown documentation for core and addons. on: push: @@ -29,14 +29,6 @@ jobs: repository: OSGeo/grass path: grass - - name: Checkout addons - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - repository: OSGeo/grass-addons - # This could be taken from the source code by the utils script. - ref: grass8 - path: grass-addons - - name: Get dependencies run: | sudo apt-get update -y @@ -44,6 +36,12 @@ jobs: xargs -a <(awk '! /^ *(#|$)/' "grass/.github/workflows/apt.txt") -r -- \ sudo apt-get install -y --no-install-recommends --no-install-suggests + - name: Set up Python + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: 3.12 + cache: pip + - name: Create installation directory run: | mkdir "$HOME/install" @@ -72,12 +70,25 @@ jobs: - name: Test executing of the grass command run: ./grass/.github/workflows/test_simple.sh - - name: Compile addons - continue-on-error: true + - name: Set version variables run: | cd grass eval $(./utils/update_version.py status --bash) - cd .. + echo "MAJOR=$MAJOR" >> $GITHUB_ENV + echo "MINOR=$MINOR" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "YEAR=$YEAR" >> $GITHUB_ENV + + - name: Checkout addons + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + repository: OSGeo/grass-addons + ref: grass${{ env.MAJOR }} + path: grass-addons + + - name: Compile addons + continue-on-error: true + run: | ./grass-addons/utils/cronjobs_osgeo_lxd/compile_addons_git.sh \ "$MAJOR" \ "$MINOR" \ @@ -86,16 +97,24 @@ jobs: $(pwd)/addons-build-dir \ grass - - name: Create env variable + - name: Get target path for Markdown files run: | echo MKDOCS_DIR="$(grass --config path)/docs/mkdocs" >> "$GITHUB_ENV" - - name: Compile addons + - name: Move from build to target directory continue-on-error: true run: | mkdir -p "$MKDOCS_DIR/source/addons" mv addons-build-dir/docs/md/source/* "$MKDOCS_DIR/source/addons" + - name: Rebuild keywords + continue-on-error: true + run: | + export ARCH_DISTDIR="$(grass --config path)" + export TOP_DOCS_DIR="${ARCH_DISTDIR}/docs" + export VERSION_NUMBER="$VERSION" + grass --tmp-project XY --exec python grass/man/build_keywords.py "$TOP_DOCS_DIR" "$MKDOCS_DIR/source/addons" + - name: Get mkdocs run: | pip install -r "grass/man/mkdocs/requirements.txt"