4141
4242jobs :
4343
44- # Build documentation handling warnings as errors.
45- # If success, upload built docs. If failure, notify telegram and upload logs.
44+ # Build documentation handling warnings as errors in both HTML and PDF.
45+ # If success, upload built docs as artifact.
46+ # If failure in HTML, notify telegram and upload logs.
4647 build :
4748 name : Build translated docs
4849 runs-on : ubuntu-latest
50+ strategy :
51+ fail-fast : false
52+ matrix :
53+ format : [ html, latex ]
4954 steps :
5055 - uses : actions/checkout@v5
5156 with :
@@ -70,17 +75,17 @@ jobs:
7075
7176 - name : Build docs
7277 id : build
73- run : ./scripts/build.sh
78+ run : ./scripts/build.sh ${{ matrix.format }}
7479
7580 - name : Upload artifact - docs
7681 if : steps.build.outcome == 'success'
7782 uses : actions/upload-artifact@v4.3.5
7883 with :
79- name : docs
80- path : cpython/Doc/build/html
84+ name : build-${{ inputs.version }}-${{ matrix.format }}
85+ path : cpython/Doc/build/${{ matrix.format }}
8186
8287 - name : Prepare notification (only on error)
83- if : always() && steps.build.outcome == 'failure'
88+ if : always() && steps.build.outcome == 'failure' && matrix.format == 'html'
8489 id : prepare
8590 run : |
8691 scripts/prepmsg.sh logs/sphinxwarnings.txt logs/notify.txt
@@ -106,6 +111,21 @@ jobs:
106111 name : ${{ inputs.version }}-build-logs
107112 path : logs/*
108113
114+ # Build Python docs in PDF format and make available for download.
115+ output-pdf :
116+ runs-on : ubuntu-latest
117+ needs : [ 'build' ]
118+ steps :
119+ - uses : actions/download-artifact@v5
120+ with :
121+ name : build-${{ inputs.version }}-latex
122+ - run : sudo apt-get update
123+ - run : sudo apt-get install -y latexmk texlive-xetex fonts-freefont-otf xindy
124+ - run : make
125+ - uses : actions/upload-artifact@v4
126+ with :
127+ name : build-${{ inputs.version }}-pdf
128+ path : .
109129
110130 # Run sphinx-lint to find wrong reST syntax in PO files. Always store logs.
111131 # If issues are found, notify telegram and upload logs.
0 commit comments