From 8015a0a63887d1141005c3bb8f054fedc7648421 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 17 Oct 2023 10:27:34 -0700 Subject: [PATCH 1/4] .github/workflows/doc-build.yml: Repair display of changed output files after mathjax CDN change --- .github/workflows/doc-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 355e07ab78e..31a6e9aecc7 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -79,7 +79,7 @@ jobs: if [ ! -f worktree-image/.gitignore ]; then cp .gitignore worktree-image/; fi (cd worktree-image && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset --quiet old && git add -N . && git status) # Keep track of changes to built HTML - new_version=$(cat src/VERSION.txt); (cd /sage/local/share/doc/sage/html/en && find . -name "*.html" | xargs sed -i '/class="sidebar-brand-text"/s/Sage [0-9a-z.]* /Sage '$new_version' /'; git init && (echo "*.svg binary"; echo "*.pdf binary") >> .gitattributes && (echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; git add -A && git commit --quiet -m "old") + new_version=$(cat src/VERSION.txt); (cd /sage/local/share/doc/sage/html/en && find . -name "*.html" | xargs sed -i '/class="sidebar-brand-text"/s/Sage [0-9a-z.]* /Sage '$new_version' /;s,/sage/local/share/mathjax/mathjax/tex-chtml.js,https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js,;'; git init && (echo "*.svg binary"; echo "*.pdf binary") >> .gitattributes && (echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; git add -A && git commit --quiet -m "old") - name: Download upstream artifact uses: actions/download-artifact@v3 From 7e5a6d8ea6688d397f946f83994c29d8f50c4f01 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 18 Oct 2023 20:02:22 -0700 Subject: [PATCH 2/4] .github/workflows/doc-build.yml: Do not duplicate the URL configured in sage_docbuild.conf --- .github/workflows/doc-build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index d27fab6d3d3..8ace5b09151 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -79,7 +79,15 @@ jobs: if [ ! -f worktree-image/.gitignore ]; then cp .gitignore worktree-image/; fi (cd worktree-image && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset --quiet old && git add -N . && git status) # Keep track of changes to built HTML - new_version=$(cat src/VERSION.txt); (cd /sage/local/share/doc/sage/html/en && find . -name "*.html" | xargs sed -i '/class="sidebar-brand-text"/s/Sage [0-9a-z.]* /Sage '$new_version' /;s,/sage/local/share/mathjax/mathjax/tex-chtml.js,https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js,;'; git init && (echo "*.svg binary"; echo "*.pdf binary") >> .gitattributes && (echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; git add -A && git commit --quiet -m "old") + new_version=$(cat src/VERSION.txt) + mathjax_path_from=$(SAGE_USE_CDNS=no ./sage -python -c "from sage_docbuild.conf import mathjax_path; print(mathjax_path)") + mathjax_path_to=$(SAGE_USE_CDNS=yes ./sage -python -c "from sage_docbuild.conf import mathjax_path; print(mathjax_path)") + (cd /sage/local/share/doc/sage/html/en && \ + find . -name "*.html" | xargs sed -i '/class="sidebar-brand-text"/s/Sage [0-9a-z.]* /Sage '$new_version' /;s,'$mathjax_path_from,$mathjax_path_to,';'; \ + git init && \ + (echo "*.svg binary"; echo "*.pdf binary") >> .gitattributes && \ + (echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; \ + git add -A && git commit --quiet -m "old") - name: Download upstream artifact uses: actions/download-artifact@v3 From 6d7bcf92dbfea7b94a202fc173c12ef8a2b913af Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 18 Oct 2023 20:22:04 -0700 Subject: [PATCH 3/4] .github/workflows/doc-build.yml: Do not duplicate the URL configured in sage_docbuild.conf (fixup) --- .github/workflows/doc-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 5a3f69f1f2a..bb0655433f5 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -56,11 +56,11 @@ jobs: git config --global --add safe.directory $(pwd) git config --global user.email "ci-sage@example.com" git config --global user.name "Build & Test workflow" + mathjax_path_from=$(SAGE_USE_CDNS=no /sage/sage -python -c "from sage_docbuild.conf import mathjax_path; print(mathjax_path)") .ci/retrofit-worktree.sh worktree-image /sage # Keep track of changes to built HTML new_version=$(cat src/VERSION.txt) - mathjax_path_from=$(SAGE_USE_CDNS=no ./sage -python -c "from sage_docbuild.conf import mathjax_path; print(mathjax_path)") - mathjax_path_to=$(SAGE_USE_CDNS=yes ./sage -python -c "from sage_docbuild.conf import mathjax_path; print(mathjax_path)") + mathjax_path_to=$(SAGE_USE_CDNS=yes /sage/sage -python -c "from sage_docbuild.conf import mathjax_path; print(mathjax_path)") (cd /sage/local/share/doc/sage/html/en && \ find . -name "*.html" | xargs sed -i '/class="sidebar-brand-text"/s/Sage [0-9a-z.]* /Sage '$new_version' /;s,'$mathjax_path_from,$mathjax_path_to,';'; \ git init && \ From 76c854969df957a56add5426361abf4cb7aadc61 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 18 Oct 2023 20:34:47 -0700 Subject: [PATCH 4/4] .github/workflows/doc-build.yml: Use make sagemath_doc_html-build-deps, make sagemath_doc_html-no-deps --- .github/workflows/doc-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index bb0655433f5..6588eac882d 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -85,7 +85,7 @@ jobs: id: incremental run: | # Now re-bootstrap and build. The build is incremental because we were careful with the timestamps. - ./bootstrap && make build + ./bootstrap && make sagemath_doc_html-build-deps working-directory: ./worktree-image env: MAKE: make -j2 --output-sync=recurse @@ -96,7 +96,7 @@ jobs: if: always() && steps.worktree.outcome == 'success' && steps.incremental.outcome != 'success' run: | set -ex - make sagelib-clean && git clean -fx src/sage && ./config.status && make build + make sagelib-clean && git clean -fx src/sage && ./config.status && make sagemath_doc_html-build-deps working-directory: ./worktree-image env: MAKE: make -j2 --output-sync=recurse @@ -113,7 +113,7 @@ jobs: mv /sage/local/share/doc/sage/html/en/.git /sage/.git-doc make doc-clean doc-uninstall mkdir -p /sage/local/share/doc/sage/html/en/ && mv /sage/.git-doc /sage/local/share/doc/sage/html/en/.git - ./config.status && make doc-html + ./config.status && make sagemath_doc_html-no-deps working-directory: ./worktree-image env: MAKE: make -j2 --output-sync=recurse