Skip to content

Commit c687a04

Browse files
authored
updates reflecting recent changes to workflow yaml
also, now docs will be built only for the most-recent 5 releases (plus dev and master)
1 parent c36c0f4 commit c687a04

1 file changed

Lines changed: 9 additions & 21 deletions

File tree

docs/build_docs.sh

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,6 @@ set -x
1717
# MAIN BODY #
1818
################################################################################
1919

20-
###################
21-
# INSTALL DEPENDS #
22-
###################
23-
24-
apt-get update
25-
apt-get -y install git rsync python3-stemmer python3-git python3-pip python3-venv python3-setuptools
26-
27-
# Create a new virtual environment and activate it
28-
python3 -m venv build_docs_venv
29-
source build_docs_venv/bin/activate
30-
31-
python3 -m pip install --upgrade -r docs/requirements.txt
32-
33-
# Workaround for github action issue with different user vs owner
34-
git config --global --add safe.directory `pwd`
35-
3620
#####################
3721
# DECLARE VARIABLES #
3822
#####################
@@ -56,8 +40,15 @@ echo "Repo: ${REPO_NAME} - TempDir: ${docroot}"
5640
# first, cleanup any old builds' static assets
5741
make -C docs clean
5842

59-
# get a list of branches, excluding 'HEAD' and 'gh-pages'
60-
versions="`git for-each-ref '--format=%(refname:lstrip=-1)' refs/remotes/origin/ | grep -viE '^(HEAD|gh-pages)$'`"
43+
# Get all branches excluding HEAD and gh-pages
44+
all_branches=$(git for-each-ref --format='%(refname:lstrip=-1)' refs/remotes/origin/ | grep -viE '^(HEAD|gh-pages)$')
45+
# Separate release branches (v#.#.#) and keep only latest 5
46+
release_branches=$(echo "$all_branches" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 5)
47+
# Non-release branches
48+
other_branches=$(echo "$all_branches" | grep -v -E '^v[0-9]+\.[0-9]+\.[0-9]+$')
49+
# Combine: non-release branches + latest 5 releases
50+
versions=$(echo -e "${other_branches}\n${release_branches}")
51+
6152
for current_version in ${versions}; do
6253

6354
# make the current language available to conf.py
@@ -171,9 +162,6 @@ popd # return to main repo sandbox root
171162
# CLEANUP & EXIT #
172163
##################
173164

174-
# Deactivate virtual environment
175-
deactivate
176-
177165
# exit cleanly
178166
exit 0
179167

0 commit comments

Comments
 (0)