Skip to content

Commit 98e19c1

Browse files
author
Release Manager
committed
gh-40379: Fix docbuilding on release tag <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> After #39973, some necessary steps during the docbuild on release tags are no longer run (see https://github.com/sagemath/sage/actions/runs/161 00707903/job/45429461356). Sorry - that was my fault. This is fixed here. Test run: https://github.com/tobiasdiez/sage/actions/runs/16323033505/jo b/46105684396 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] 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 and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> - #40383 URL: #40379 Reported by: Tobias Diez Reviewer(s): Dima Pasechnik
2 parents b9cbfdd + 109a1e1 commit 98e19c1

15 files changed

+727
-508
lines changed

.github/workflows/doc-build.yml

Lines changed: 38 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,12 @@ jobs:
6969
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
7070
export CC="ccache $CC"
7171
export CXX="ccache $CXX"
72-
pip install --no-build-isolation --config-settings=builddir=builddir --editable . -v
72+
pip install --no-build-isolation --config-settings=builddir=builddir . -v
7373
7474
#
7575
# For pull requests
7676
#
7777
- name: Get workflow run-id
78-
id: get_run_id
7978
if: github.event_name == 'pull_request'
8079
run: |
8180
RESPONSE=$(curl -s -L \
@@ -87,8 +86,7 @@ jobs:
8786
echo "RUN_ID=$RUN_ID" >> $GITHUB_ENV
8887
8988
- name: Download old doc
90-
id: download-doc
91-
if: steps.get_run_id.outcome == 'success'
89+
if: github.event_name == 'pull_request'
9290
uses: actions/download-artifact@v4
9391
with:
9492
name: doc-develop
@@ -97,8 +95,7 @@ jobs:
9795
run-id: ${{ env.RUN_ID }}
9896

9997
- name: Store old doc
100-
id: worktree
101-
if: steps.download-doc.outcome == 'success'
98+
if: github.event_name == 'pull_request'
10299
shell: bash -l {0}
103100
run: |
104101
git config --global --add safe.directory $(pwd)
@@ -137,8 +134,6 @@ jobs:
137134
fi
138135
139136
- name: Build documentation
140-
id: docbuild
141-
if: steps.worktree.outcome == 'success'
142137
shell: bash -l {0}
143138
run: |
144139
meson compile -C builddir doc-html
@@ -147,14 +142,13 @@ jobs:
147142
SAGE_DOCBUILD_OPTS: "--include-tests-blocks"
148143

149144
- name: Copy doc
150-
id: copy
151-
if: steps.docbuild.outcome == 'success'
152145
run: |
153146
set -ex
154147
# Remove any existing html directory before copying a new one
155148
if [ -d "doc/html" ]; then
156149
rm -rf doc/html
157150
fi
151+
mkdir -p doc
158152
cp -r builddir/src/doc/* doc/
159153
# Check if we are on pull request event
160154
PR_NUMBER=""
@@ -193,53 +187,50 @@ jobs:
193187
zip -r doc.zip doc
194188
195189
- name: Upload doc
196-
id: upload
197-
if: steps.copy.outcome == 'success'
198190
uses: actions/upload-artifact@v4
199191
with:
200192
name: doc
201193
path: doc.zip
202194

195+
#
196+
# On release events
197+
#
198+
203199
- name: Upload doc-develop
204200
# artifact doc-develop is used for doc build on pull request event
205-
id: upload-push
206-
if: steps.copy.outcome == 'success' && github.event_name == 'push'
201+
if: github.event_name != 'pull_request'
207202
uses: actions/upload-artifact@v4
208203
with:
209204
name: doc-${{ github.ref_name }}
210205
path: doc.zip
211206

212-
#
213-
# On release tag event
214-
#
215-
216-
- name: Build live doc
217-
id: buildlivedoc
218-
if: startsWith(github.ref, 'refs/tags/')
219-
shell: bash -l {0}
220-
run: |
221-
meson compile -C builddir doc-html
222-
env:
223-
SAGE_USE_CDNS: yes
224-
SAGE_LIVE_DOC: yes
225-
SAGE_JUPYTER_SERVER: binder:sagemath/sage-binder-env/dev
226-
SAGE_DOCBUILD_OPTS: "--include-tests-blocks"
227-
228-
- name: Copy live doc
229-
id: copylivedoc
230-
if: steps.buildlivedoc.outcome == 'success'
231-
run: |
232-
mkdir -p ./livedoc
233-
# We copy everything to a local folder
234-
cp -r builddir/src/doc/html livedoc/
235-
cp -r builddir/src/doc/pdf livedoc/
236-
cp builddir/src/doc/index.html livedoc/
237-
zip -r livedoc.zip livedoc
238-
239-
- name: Upload live doc
240-
if: steps.copylivedoc.outcome == 'success'
241-
uses: actions/upload-artifact@v4
242-
with:
243-
name: livedoc
244-
path: livedoc.zip
207+
# The following fails randomly
208+
# - name: Build live doc
209+
# if: github.event_name != 'pull_request'
210+
# shell: bash -l {0}
211+
# run: |
212+
# # Remove previous doc build
213+
# rm -rf builddir/src/doc
214+
# meson compile -C builddir doc-html
215+
# env:
216+
# SAGE_USE_CDNS: yes
217+
# SAGE_LIVE_DOC: yes
218+
# SAGE_JUPYTER_SERVER: binder:sagemath/sage-binder-env/dev
219+
# SAGE_DOCBUILD_OPTS: "--include-tests-blocks"
220+
221+
# - name: Copy live doc
222+
# if: github.event_name != 'pull_request'
223+
# run: |
224+
# mkdir -p ./livedoc
225+
# # We copy everything to a local folder
226+
# cp -r builddir/src/doc/html livedoc/
227+
# cp builddir/src/doc/index.html livedoc/
228+
# zip -r livedoc.zip livedoc
229+
230+
# - name: Upload live doc
231+
# if: github.event_name != 'pull_request'
232+
# uses: actions/upload-artifact@v4
233+
# with:
234+
# name: livedoc
235+
# path: livedoc.zip
245236

.github/workflows/doc-publish.yml

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -100,67 +100,67 @@ jobs:
100100
echo "::notice::The documentation has been deployed - ${{ steps.deploy-netlify.outputs.NETLIFY_URL }}"
101101
if: steps.download-doc.outcome == 'success'
102102

103-
publish-live-doc:
104-
runs-on: ubuntu-latest
105-
if: github.event.workflow_run.conclusion == 'success'
106-
env:
107-
CAN_DEPLOY: ${{ secrets.NETLIFY_AUTH_TOKEN != '' && secrets.NETLIFY_SITE_ID != '' }}
108-
steps:
109-
- name: Get information about workflow origin
110-
uses: potiuk/get-workflow-origin@v1_5
111-
id: source-run-info
112-
with:
113-
token: ${{ secrets.GITHUB_TOKEN }}
114-
sourceRunId: ${{ github.event.workflow_run.id }}
115-
if: env.CAN_DEPLOY == 'true'
116-
117-
- name: Download live doc
118-
id: download-doc
119-
uses: actions/download-artifact@v4
120-
with:
121-
name: livedoc
122-
github-token: ${{ secrets.GITHUB_TOKEN }}
123-
repository: ${{ github.repository }}
124-
run-id: ${{ github.event.workflow_run.id }}
125-
# if the doc was built for tag push (targetBranch contains the tag)
126-
if: steps.source-run-info.outputs.sourceEvent == 'push' && steps.source-run-info.outputs.targetBranch != 'develop'
127-
128-
- name: Extract live doc
129-
run: unzip livedoc.zip -d livedoc
130-
if: steps.download-doc.outcome == 'success'
131-
132-
- name: Create _headers file for permissive CORS
133-
run: |
134-
cat <<EOF > livedoc/livedoc/_headers
135-
/*
136-
Access-Control-Allow-Origin: *
137-
Access-Control-Allow-Methods: GET
138-
Access-Control-Allow-Headers: Content-Type
139-
EOF
140-
if: steps.download-doc.outcome == 'success'
141-
142-
- name: Deploy to netlify with doc-TAG alias
143-
id: deploy-netlify
144-
uses: netlify/actions/cli@master
145-
with:
146-
args: deploy --dir=livedoc/livedoc --message ${NETLIFY_MESSAGE} --alias ${NETLIFY_ALIAS}
147-
env:
148-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
149-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
150-
NETLIFY_MESSAGE: doc-${{ steps.source-run-info.outputs.targetBranch }}
151-
NETLIFY_ALIAS: doc-${{ steps.source-run-info.outputs.targetBranch }}
152-
if: steps.download-doc.outcome == 'success'
153-
154-
- name: Deploy to netlify with doc-release alias
155-
uses: netlify/actions/cli@master
156-
with:
157-
args: deploy --dir=livedoc/livedoc --message doc-release --alias doc-release
158-
env:
159-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
160-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
161-
if: steps.download-doc.outcome == 'success'
162-
163-
- name: Report deployment url
164-
run: |
165-
echo "::notice::The live documentation has been deployed - ${{ steps.deploy-netlify.outputs.NETLIFY_URL }}"
166-
if: steps.download-doc.outcome == 'success'
103+
# publish-live-doc:
104+
# runs-on: ubuntu-latest
105+
# if: github.event.workflow_run.conclusion == 'success'
106+
# env:
107+
# CAN_DEPLOY: ${{ secrets.NETLIFY_AUTH_TOKEN != '' && secrets.NETLIFY_SITE_ID != '' }}
108+
# steps:
109+
# - name: Get information about workflow origin
110+
# uses: potiuk/get-workflow-origin@v1_5
111+
# id: source-run-info
112+
# with:
113+
# token: ${{ secrets.GITHUB_TOKEN }}
114+
# sourceRunId: ${{ github.event.workflow_run.id }}
115+
# if: env.CAN_DEPLOY == 'true'
116+
117+
# - name: Download live doc
118+
# id: download-doc
119+
# uses: actions/download-artifact@v4
120+
# with:
121+
# name: livedoc
122+
# github-token: ${{ secrets.GITHUB_TOKEN }}
123+
# repository: ${{ github.repository }}
124+
# run-id: ${{ github.event.workflow_run.id }}
125+
# # if the doc was built for tag push (targetBranch contains the tag)
126+
# if: steps.source-run-info.outputs.sourceEvent == 'push' && steps.source-run-info.outputs.targetBranch != 'develop'
127+
128+
# - name: Extract live doc
129+
# run: unzip livedoc.zip -d livedoc
130+
# if: steps.download-doc.outcome == 'success'
131+
132+
# - name: Create _headers file for permissive CORS
133+
# run: |
134+
# cat <<EOF > livedoc/livedoc/_headers
135+
# /*
136+
# Access-Control-Allow-Origin: *
137+
# Access-Control-Allow-Methods: GET
138+
# Access-Control-Allow-Headers: Content-Type
139+
# EOF
140+
# if: steps.download-doc.outcome == 'success'
141+
142+
# - name: Deploy to netlify with doc-TAG alias
143+
# id: deploy-netlify
144+
# uses: netlify/actions/cli@master
145+
# with:
146+
# args: deploy --dir=livedoc/livedoc --message ${NETLIFY_MESSAGE} --alias ${NETLIFY_ALIAS}
147+
# env:
148+
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
149+
# NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
150+
# NETLIFY_MESSAGE: doc-${{ steps.source-run-info.outputs.targetBranch }}
151+
# NETLIFY_ALIAS: doc-${{ steps.source-run-info.outputs.targetBranch }}
152+
# if: steps.download-doc.outcome == 'success'
153+
154+
# - name: Deploy to netlify with doc-release alias
155+
# uses: netlify/actions/cli@master
156+
# with:
157+
# args: deploy --dir=livedoc/livedoc --message doc-release --alias doc-release
158+
# env:
159+
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
160+
# NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
161+
# if: steps.download-doc.outcome == 'success'
162+
163+
# - name: Report deployment url
164+
# run: |
165+
# echo "::notice::The live documentation has been deployed - ${{ steps.deploy-netlify.outputs.NETLIFY_URL }}"
166+
# if: steps.download-doc.outcome == 'success'

0 commit comments

Comments
 (0)