Skip to content

Commit

Permalink
Get addons according to the version (breaks for major version transit…
Browse files Browse the repository at this point in the history
…ions when addons branch may not exist), rebuild keywords, rename file
  • Loading branch information
wenzeslaus committed Feb 20, 2025
1 parent 4bf32ad commit f03a23c
Showing 1 changed file with 33 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Documentation

# Build documentation
# Builds Markdown documentation for core and addons.

on:
push:
Expand Down Expand Up @@ -29,21 +29,19 @@ 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
sudo apt-get install -y wget git gawk findutils
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"
Expand Down Expand Up @@ -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" \
Expand All @@ -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"
Expand Down

0 comments on commit f03a23c

Please sign in to comment.