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 :
47- name : Build translated docs
48+ name : Build docs
4849 runs-on : ubuntu-latest
50+ strategy :
51+ fail-fast : false
52+ matrix :
53+ format : [ html, latex, epub ]
4954 steps :
5055 - uses : actions/checkout@v5
5156 with :
@@ -70,20 +75,13 @@ jobs:
7075
7176 - name : Build docs
7277 id : build
73- run : ./scripts/build.sh
74-
75- - name : Upload artifact - docs
76- if : steps.build.outcome == 'success'
77- 78- with :
79- name : docs
80- path : cpython/Doc/build/html
78+ run : ./scripts/build.sh ${{ matrix.format }}
8179
8280 - name : Prepare notification (only on error)
83- if : always() && steps.build.outcome == 'failure'
81+ if : always() && steps.build.outcome == 'failure' && matrix.format == 'html'
8482 id : prepare
8583 run : |
86- scripts/prepmsg.sh logs/sphinxwarnings.txt logs/notify.txt
84+ scripts/prepmsg.sh logs/sphinxwarnings-${format} .txt logs/notify.txt
8785 cat logs/notify.txt
8886 env :
8987 GITHUB_JOB : ${{ github.job }}
@@ -101,11 +99,34 @@ jobs:
10199
102100 - name : Upload artifact - log files
103101 if : always() && steps.build.outcome == 'failure'
104- uses : actions/upload-artifact@v4
102+ uses : actions/upload-artifact@v4.3.5
105103 with :
106- name : ${{ inputs.version }}-build-logs
104+ name : logs- ${{ inputs.version }}-${{ matrix.format }}
107105 path : logs/*
106+
107+ - name : Upload artifact - docs
108+ if : always() && steps.build.outcome == 'success'
109+ 110+ with :
111+ name : python-docs-pt-br-${{ inputs.version }}-${{ matrix.format }}
112+ path : cpython/Doc/build/${{ matrix.format }}
108113
114+ # Build Python docs in PDF format and make available for download.
115+ output-pdf :
116+ name : Build docs (pdf)
117+ runs-on : ubuntu-latest
118+ needs : [ 'build' ]
119+ steps :
120+ - uses : actions/download-artifact@v5
121+ with :
122+ name : python-docs-pt-br-${{ inputs.version }}-latex
123+ - run : sudo apt-get update
124+ - run : sudo apt-get install -y latexmk texlive-xetex fonts-freefont-otf xindy texlive-lang-portuguese
125+ - run : make
126+ - uses : actions/upload-artifact@v4
127+ with :
128+ name : python-docs-pt-br-${{ inputs.version }}-pdf
129+ path : ./*.pdf
109130
110131 # Run sphinx-lint to find wrong reST syntax in PO files. Always store logs.
111132 # If issues are found, notify telegram and upload logs.
0 commit comments