Skip to content

Commit 404d9e5

Browse files
author
Release Manager
committed
gh-35808: .github/workflows/doc-build.yml: Fix generation of CHANGES.html <!-- Please provide a concise, informative and self-explanatory title. --> <!-- Don't put issue numbers in the title. Put it in the Description below. --> <!-- For example, instead of "Fixes #12345", use "Add a new method to multiply two integers" --> ### 📚 Description This new feature from #35652 was supposed to show the changed HTML files, but a last minute change there destroyed it. Here we fix it. <!-- Describe your changes here in detail. --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x ]`. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #35808 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe
2 parents c80cc11 + ebde730 commit 404d9e5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/doc-build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
if [ ! -f worktree-image/.gitignore ]; then cp .gitignore worktree-image/; fi
5151
(cd worktree-image && git add -A && git commit --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset old)
5252
# Keep track of changes to built HTML
53-
(cd /sage/local/share/doc/sage/html/en && find . -name "*.html" | xargs sed -i '/class="sidebar-brand-text"/s/Sage [0-9a-z.]* /Sage dev /'; git init && (echo ".buildinfo"; echo ".inv") > .gitignore; git add -A && git commit --quiet -m "old")
53+
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")
5454
5555
- name: Incremental build
5656
id: incremental
@@ -80,7 +80,10 @@ jobs:
8080
# incremental docbuild may introduce broken links (inter-file references) though build succeeds
8181
run: |
8282
set -ex
83-
make doc-clean doc-uninstall sagelib-clean && git clean -fx src/sage && ./config.status && make doc-html
83+
mv /sage/local/share/doc/sage/html/en/.git /sage/.git-doc
84+
make doc-clean doc-uninstall sagelib-clean && git clean -fx src/sage
85+
mkdir -p /sage/local/share/doc/sage/html/en/ && mv /sage/.git-doc /sage/local/share/doc/sage/html/en/.git
86+
./config.status && make doc-html
8487
working-directory: ./worktree-image
8588
env:
8689
MAKE: make -j2
@@ -94,7 +97,7 @@ jobs:
9497
mkdir -p ./docs
9598
# Create changelog
9699
echo '## Preview of CHANGES.html'
97-
(cd /sage/local/share/doc/sage/html/en && find . -name "*.html" | xargs sed -i '/class="sidebar-brand-text"/s/Sage [0-9a-z.]* /Sage dev /'; git diff --name-only) | tee ./docs/CHANGES.txt
100+
(cd /sage/local/share/doc/sage/html/en && git diff --name-only) | tee ./docs/CHANGES.txt
98101
(cd /sage/local/share/doc/sage/html/en && git diff; rm -rf .git) > ./docs/html.diff
99102
echo '## Preview of html.diff'; head -n 400 ./docs/html.diff
100103
(echo '<p><a href="html.diff">HTML diff</a>'; sed -E 's,(.*),<p><a href="\1">\1</a>,' ./docs/CHANGES.txt) > ./docs/CHANGES.html

0 commit comments

Comments
 (0)