1919name : " Build Python source and docs artifacts"
2020
2121jobs :
22- build-source-and-docs :
22+ verify-input :
2323 runs-on : ubuntu-22.04
2424 steps :
2525 - name : " Workflow run information"
2828 echo "git_commit: ${{ inputs.git_commit }}"
2929 echo "cpython_release: ${{ inputs.cpython_release }}"
3030
31- - name : " Checkout python/release-tools"
32- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
33-
3431 - name : " Checkout ${{ inputs.git_remote }}/cpython"
3532 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3633 with :
4542 exit 1
4643 fi
4744
45+ build-source :
46+ runs-on : ubuntu-22.04
47+ needs :
48+ - verify-input
49+ steps :
50+ - name : " Checkout python/release-tools"
51+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
52+
53+ - name : " Checkout ${{ inputs.git_remote }}/cpython"
54+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
55+ with :
56+ repository : " ${{ inputs.git_remote }}/cpython"
57+ ref : " v${{ inputs.cpython_release }}"
58+ path : " cpython"
59+
4860 - name : " Setup Python"
4961 uses : actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
5062 with :
@@ -55,45 +67,65 @@ jobs:
5567 python -m pip install --no-deps \
5668 -r requirements.txt
5769
70+ - name : " Build Python release artifacts"
71+ run : |
72+ cd cpython
73+ python ../release.py --export ${{ inputs.cpython_release }} --skip-docs
74+
75+ - name : " Upload the source artifacts"
76+ uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
77+ with :
78+ name : source
79+ path : |
80+ cpython/${{ inputs.cpython_release }}/src
81+
82+ build-docs :
83+ runs-on : ubuntu-22.04
84+ needs :
85+ - verify-input
86+
87+ # Docs aren't built for alpha or beta releases.
88+ if : ${{ !(contains(inputs.cpython_release, 'a') || contains(inputs.cpython_release, 'b')) }}
89+
90+ steps :
91+ - name : " Checkout ${{ inputs.git_remote }}/cpython"
92+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
93+ with :
94+ repository : " ${{ inputs.git_remote }}/cpython"
95+ ref : " v${{ inputs.cpython_release }}"
96+
97+ - name : " Setup Python"
98+ uses : actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
99+ with :
100+ python-version : 3.11
101+
58102 - name : " Install docs dependencies"
59- # Docs aren't built for alpha or beta releases.
60- if : ${{ !(contains(inputs.cpython_release, 'a') || contains(inputs.cpython_release, 'b')) }}
61103 run : |
62104 python -m pip install \
63- -r cpython/ Doc/requirements.txt
105+ -r Doc/requirements.txt
64106
65107 sudo apt-get update
66108 sudo apt-get install --yes --no-install-recommends \
67109 latexmk texlive-xetex xindy texinfo texlive-latex-base \
68110 texlive-fonts-recommended texlive-fonts-extra \
69111 texlive-full
70112
71- - name : " Build Python release artifacts "
113+ - name : " Build docs "
72114 run : |
73- cd cpython
74- python ../release.py --export ${{ inputs.cpython_release }}
75-
76- - name : " Upload the source artifacts"
77- uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
78- with :
79- name : source
80- path : |
81- cpython/${{ inputs.cpython_release }}/src
115+ cd Doc
116+ SPHINXOPTS="-j10" make dist
82117
83118 - name : " Upload the docs artifacts"
84119 uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
85- # Conditionally run this step if there is a 'docs/' directory.
86- # Docs aren't built for alpha or beta releases.
87- if : ${{ hashFiles(format('cpython/{0}/docs', inputs.cpython_release)) != '' }}
88120 with :
89121 name : docs
90122 path : |
91- cpython/${{ inputs.cpython_release }}/docs
123+ Doc/dist/
92124
93125 test-source :
94126 runs-on : ubuntu-22.04
95127 needs :
96- - build-source-and-docs
128+ - build-source
97129 steps :
98130 - name : " Download the source artifacts"
99131 uses : actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
0 commit comments