2121permissions :
2222 contents : write
2323jobs :
24- build :
24+ build-html :
2525 runs-on : ubuntu-latest
2626 steps :
2727 - uses : actions/setup-python@master
@@ -33,105 +33,159 @@ jobs:
3333 ref : ${{ github.event.inputs.reference }}
3434 - run : make venv
3535 working-directory : ./Doc
36- - run : sudo apt-get update
37- - run : sudo apt-get install -y latexmk texlive-xetex fonts-freefont-otf xindy texinfo librsvg2-bin
3836 - run : make dist-html
39- id : build-html
4037 working-directory : ./Doc
41- continue-on-error : true
42- - run : make dist-text
43- id : build-text
44- working-directory : ./Doc
45- continue-on-error : true
46- - run : make dist-texinfo
47- id : build-texinfo
48- working-directory : ./Doc
49- continue-on-error : true
50- - run : make dist-epub
51- id : build-epub
52- working-directory : ./Doc
53- continue-on-error : true
54- - run : make dist-pdf
55- id : build-pdf
56- working-directory : ./Doc
57- continue-on-error : true
58- - uses : actions/upload-artifact@master
59- with :
60- name : pdf-logs.zip
61- path : |
62- ./Doc/build/latex/*.log
63- ./Doc/build/latex/*.tex
64- - uses : actions/upload-artifact@master
65- with :
66- name : docs-pdf-a4.zip
67- path : ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs-pdf-a4.zip
68- if-no-files-found : ignore
69- - uses : actions/upload-artifact@master
70- with :
71- name : docs-pdf-a4.tar.bz2
72- path : ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs-pdf-a4.tar.bz2
73- if-no-files-found : ignore
7438 - uses : actions/upload-artifact@master
39+ if : always()
7540 with :
7641 name : docs-html.zip
7742 path : ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs-html.zip
7843 if-no-files-found : ignore
7944 - uses : actions/upload-artifact@master
45+ if : always()
8046 with :
8147 name : docs-html.tar.bz2
8248 path : ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs-html.tar.bz2
8349 if-no-files-found : ignore
50+ build-text :
51+ runs-on : ubuntu-latest
52+ steps :
53+ - uses : actions/setup-python@master
54+ with :
55+ python-version : 3
56+ - uses : actions/checkout@master
57+ with :
58+ repository : ${{ github.event.inputs.repository }}
59+ ref : ${{ github.event.inputs.reference }}
60+ - run : make venv
61+ working-directory : ./Doc
62+ - run : make dist-text
63+ working-directory : ./Doc
8464 - uses : actions/upload-artifact@master
65+ if : always()
8566 with :
8667 name : docs-text.zip
8768 path : ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs-text.zip
8869 if-no-files-found : ignore
8970 - uses : actions/upload-artifact@master
71+ if : always()
9072 with :
9173 name : docs-text.tar.bz2
9274 path : ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs-text.tar.bz2
9375 if-no-files-found : ignore
76+ build-texinfo :
77+ runs-on : ubuntu-latest
78+ steps :
79+ - uses : actions/setup-python@master
80+ with :
81+ python-version : 3
82+ - uses : actions/checkout@master
83+ with :
84+ repository : ${{ github.event.inputs.repository }}
85+ ref : ${{ github.event.inputs.reference }}
86+ - run : make venv
87+ working-directory : ./Doc
88+ - run : sudo apt-get update && sudo apt-get install -y texinfo
89+ - run : make dist-texinfo
90+ working-directory : ./Doc
9491 - uses : actions/upload-artifact@master
92+ if : always()
9593 with :
9694 name : docs-texinfo.zip
9795 path : ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs-texinfo.zip
9896 if-no-files-found : ignore
9997 - uses : actions/upload-artifact@master
98+ if : always()
10099 with :
101100 name : docs-texinfo.tar.bz2
102101 path : ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs-texinfo.tar.bz2
103102 if-no-files-found : ignore
103+ build-epub :
104+ runs-on : ubuntu-latest
105+ steps :
106+ - uses : actions/setup-python@master
107+ with :
108+ python-version : 3
109+ - uses : actions/checkout@master
110+ with :
111+ repository : ${{ github.event.inputs.repository }}
112+ ref : ${{ github.event.inputs.reference }}
113+ - run : make venv
114+ working-directory : ./Doc
115+ - run : make dist-epub
116+ working-directory : ./Doc
104117 - uses : actions/upload-artifact@master
118+ if : always()
105119 with :
106120 name : docs.epub
107121 path : ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs.epub
108122 if-no-files-found : ignore
123+ build-pdf :
124+ runs-on : ubuntu-latest
125+ steps :
126+ - uses : actions/setup-python@master
127+ with :
128+ python-version : 3
129+ - uses : actions/checkout@master
130+ with :
131+ repository : ${{ github.event.inputs.repository }}
132+ ref : ${{ github.event.inputs.reference }}
133+ - run : make venv
134+ working-directory : ./Doc
135+ - run : sudo apt-get update && sudo apt-get install -y latexmk texlive-xetex fonts-freefont-otf xindy librsvg2-bin
136+ - run : make dist-pdf
137+ working-directory : ./Doc
138+ - uses : actions/upload-artifact@master
139+ if : always()
140+ with :
141+ name : pdf-logs.zip
142+ path : |
143+ ./Doc/build/latex/*.log
144+ ./Doc/build/latex/*.tex
145+ - uses : actions/upload-artifact@master
146+ if : always()
147+ with :
148+ name : docs-pdf-a4.zip
149+ path : ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs-pdf-a4.zip
150+ if-no-files-found : ignore
151+ - uses : actions/upload-artifact@master
152+ if : always()
153+ with :
154+ name : docs-pdf-a4.tar.bz2
155+ path : ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs-pdf-a4.tar.bz2
156+ if-no-files-found : ignore
157+ publish :
158+ needs : [build-html, build-text, build-texinfo, build-epub, build-pdf]
159+ if : ${{ !cancelled() && github.event.inputs.publish == 'true' }}
160+ runs-on : ubuntu-latest
161+ steps :
109162 - name : Checkout gh-pages branch
110- if : ${{ github.event.inputs.publish == 'true' }}
111163 uses : actions/checkout@v4
112164 with :
113165 ref : gh-pages
114166 path : gh-pages
167+ - name : Download all artifacts
168+ uses : actions/download-artifact@master
169+ with :
170+ path : artifacts
115171 - name : Copy generated archives to gh-pages
116- if : ${{ github.event.inputs.publish == 'true' }}
117172 run : |
118173 mkdir -p gh-pages/3
119174 # PDF
120- cp ./Doc/dist/python-${{ github.event.inputs.dist_version }}- docs-pdf-a4.zip gh-pages/3/ python-${{ github.event.inputs.dist_version }}-docs-pdf-a4.zip 2>/dev/null || true
121- cp ./Doc/dist/python-${{ github.event.inputs.dist_version }}- docs-pdf-a4.tar.bz2 gh-pages/3/ python-${{ github.event.inputs.dist_version }}-docs-pdf-a4.tar.bz2 2>/dev/null || true
175+ cp artifacts/ docs-pdf-a4.zip/ python-${{ github.event.inputs.dist_version }}-docs-pdf-a4.zip gh-pages/3/ 2>/dev/null || true
176+ cp artifacts/ docs-pdf-a4.tar.bz2/ python-${{ github.event.inputs.dist_version }}-docs-pdf-a4.tar.bz2 gh-pages/3/ 2>/dev/null || true
122177 # HTML
123- cp ./Doc/dist/ python-${{ github.event.inputs.dist_version }}-docs-html.zip gh-pages/3/python-${{ github.event.inputs.dist_version }}-docs-html.zip 2>/dev/null || true
124- cp ./Doc/dist/python-${{ github.event.inputs.dist_version }}- docs-html.tar.bz2 gh-pages/3/ python-${{ github.event.inputs.dist_version }}-docs-html.tar.bz2 2>/dev/null || true
178+ cp artifacts/docs-html.zip/ python-${{ github.event.inputs.dist_version }}-docs-html.zip gh-pages/3/ 2>/dev/null || true
179+ cp artifacts/ docs-html.tar.bz2/ python-${{ github.event.inputs.dist_version }}-docs-html.tar.bz2 gh-pages/3/ 2>/dev/null || true
125180 # Text
126- cp ./Doc/dist/ python-${{ github.event.inputs.dist_version }}-docs-text.zip gh-pages/3/python-${{ github.event.inputs.dist_version }}-docs-text.zip 2>/dev/null || true
127- cp ./Doc/dist/python-${{ github.event.inputs.dist_version }}- docs-text.tar.bz2 gh-pages/3/ python-${{ github.event.inputs.dist_version }}-docs-text.tar.bz2 2>/dev/null || true
181+ cp artifacts/docs-text.zip/ python-${{ github.event.inputs.dist_version }}-docs-text.zip gh-pages/3/ 2>/dev/null || true
182+ cp artifacts/ docs-text.tar.bz2/ python-${{ github.event.inputs.dist_version }}-docs-text.tar.bz2 gh-pages/3/ 2>/dev/null || true
128183 # Texinfo
129- cp ./Doc/dist/ python-${{ github.event.inputs.dist_version }}-docs-texinfo.zip gh-pages/3/python-${{ github.event.inputs.dist_version }}-docs-texinfo.zip 2>/dev/null || true
130- cp ./Doc/dist/python-${{ github.event.inputs.dist_version }}- docs-texinfo.tar.bz2 gh-pages/3/ python-${{ github.event.inputs.dist_version }}-docs-texinfo.tar.bz2 2>/dev/null || true
184+ cp artifacts/docs-texinfo.zip/ python-${{ github.event.inputs.dist_version }}-docs-texinfo.zip gh-pages/3/ 2>/dev/null || true
185+ cp artifacts/ docs-texinfo.tar.bz2/ python-${{ github.event.inputs.dist_version }}-docs-texinfo.tar.bz2 gh-pages/3/ 2>/dev/null || true
131186 # EPUB
132- cp ./Doc/dist/ python-${{ github.event.inputs.dist_version }}-docs.epub gh-pages/3/python-${{ github.event.inputs.dist_version }}-docs.epub 2>/dev/null || true
187+ cp artifacts/docs.epub/ python-${{ github.event.inputs.dist_version }}-docs.epub gh-pages/3/ 2>/dev/null || true
133188 - name : Commit generated archives
134- if : ${{ github.event.inputs.publish == 'true' }}
135189 id : commit
136190 run : |
137191 cd gh-pages
@@ -146,35 +200,9 @@ jobs:
146200 echo "has_changes=true" >> $GITHUB_OUTPUT
147201 fi
148202 - name : Push commit
149- if : ${{ github.event.inputs.publish == 'true' && steps.commit.outputs.has_changes == 'true' }}
203+ if : steps.commit.outputs.has_changes == 'true'
150204 uses : ad-m/github-push-action@master
151205 with :
152206 branch : gh-pages
153207 github_token : ${{ secrets.GITHUB_TOKEN }}
154208 directory : gh-pages
155- - name : Check for build failures
156- if : always()
157- run : |
158- failed_formats=()
159- if [ "${{ steps.build-html.outcome }}" == "failure" ]; then
160- failed_formats+=("HTML")
161- fi
162- if [ "${{ steps.build-text.outcome }}" == "failure" ]; then
163- failed_formats+=("Text")
164- fi
165- if [ "${{ steps.build-texinfo.outcome }}" == "failure" ]; then
166- failed_formats+=("Texinfo")
167- fi
168- if [ "${{ steps.build-epub.outcome }}" == "failure" ]; then
169- failed_formats+=("EPUB")
170- fi
171- if [ "${{ steps.build-pdf.outcome }}" == "failure" ]; then
172- failed_formats+=("PDF")
173- fi
174-
175- if [ ${#failed_formats[@]} -gt 0 ]; then
176- echo "The following format(s) failed to build: ${failed_formats[*]}"
177- exit 1
178- else
179- echo "All formats built successfully"
180- fi
0 commit comments