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
- name :Buildtranslated docs
48
+ name :Build docs
48
49
runs-on :ubuntu-latest
50
+ strategy :
51
+ fail-fast :false
52
+ matrix :
53
+ format :[ html, latex, epub ]
49
54
steps :
50
55
-uses :actions/checkout@v5
51
56
with :
@@ -70,20 +75,13 @@ jobs:
70
75
71
76
-name :Build docs
72
77
id :build
73
- run :./scripts/build.sh
74
-
75
- -name :Upload artifact - docs
76
- if :steps.build.outcome == 'success'
77
- uses :actions/upload-artifact@v4.3.5
78
- with :
79
- name :docs
80
- path :cpython/Doc/build/html
78
+ run :./scripts/build.sh ${{ matrix.format }}
81
79
82
80
-name :Prepare notification (only on error)
83
- if :always() && steps.build.outcome == 'failure'
81
+ if :always() && steps.build.outcome == 'failure' && matrix.format == 'html'
84
82
id :prepare
85
83
run :|
86
- scripts/prepmsg.sh logs/sphinxwarnings.txt logs/notify.txt
84
+ scripts/prepmsg.sh logs/sphinxwarnings-${format} .txt logs/notify.txt
87
85
cat logs/notify.txt
88
86
env :
89
87
GITHUB_JOB :${{ github.job }}
@@ -101,11 +99,34 @@ jobs:
101
99
102
100
-name :Upload artifact - log files
103
101
if :always() && steps.build.outcome == 'failure'
104
- uses :actions/upload-artifact@v4
102
+ uses :actions/upload-artifact@v4.3.5
105
103
with :
106
- name :${{ inputs.version }}-build-logs
104
+ name :logs- ${{ inputs.version }}-${{ matrix.format }}
107
105
path :logs/*
106
+
107
+ -name :Upload artifact - docs
108
+ if :always() && steps.build.outcome == 'success'
109
+ uses :actions/upload-artifact@v4.3.5
110
+ with :
111
+ name :python-docs-pt-br-${{ inputs.version }}-${{ matrix.format }}
112
+ path :cpython/Doc/build/${{ matrix.format }}
108
113
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
109
130
110
131
# Run sphinx-lint to find wrong reST syntax in PO files. Always store logs.
111
132
# If issues are found, notify telegram and upload logs.