41
41
42
42
jobs :
43
43
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.
46
47
build :
47
48
name : Build translated docs
48
49
runs-on : ubuntu-latest
50
+ strategy :
51
+ fail-fast : false
52
+ matrix :
53
+ format : [ html, latex ]
49
54
steps :
50
55
- uses : actions/checkout@v5
51
56
with :
@@ -70,17 +75,17 @@ jobs:
70
75
71
76
- name : Build docs
72
77
id : build
73
- run : ./scripts/build.sh
78
+ run : ./scripts/build.sh ${{ matrix.format }}
74
79
75
80
- name : Upload artifact - docs
76
81
if : steps.build.outcome == 'success'
77
82
78
83
with :
79
- name : docs
80
- path : cpython/Doc/build/html
84
+ name : build-${{ inputs.version }}-${{ matrix.format }}
85
+ path : cpython/Doc/build/${{ matrix.format }}
81
86
82
87
- name : Prepare notification (only on error)
83
- if : always() && steps.build.outcome == 'failure'
88
+ if : always() && steps.build.outcome == 'failure' && matrix.format == 'html'
84
89
id : prepare
85
90
run : |
86
91
scripts/prepmsg.sh logs/sphinxwarnings.txt logs/notify.txt
@@ -106,6 +111,21 @@ jobs:
106
111
name : ${{ inputs.version }}-build-logs
107
112
path : logs/*
108
113
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 : .
109
129
110
130
# Run sphinx-lint to find wrong reST syntax in PO files. Always store logs.
111
131
# If issues are found, notify telegram and upload logs.
0 commit comments