8888 path : mpl-src/dist/*.tar.gz
8989 if-no-files-found : error
9090
91- build_wheels :
91+ sdist_license :
9292 needs : build_sdist
93+ name : Repackage licenses in sdist for binary distribution
94+ runs-on : ubuntu-latest
95+
96+ steps :
97+ - name : Download sdist
98+ uses : actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
99+ with :
100+ name : cibw-sdist
101+ path : dist/
102+
103+ - name : Update LICENSE for binary distribution (append auxilliary licenses to LICENSE file)
104+ run : |
105+ tar -xvf dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
106+ cat ${{ github.workspace }}/tools/wheels/LICENSE_binary.txt >> matplotlib*/LICENSE/LICENSE
107+ tar -cvf dist/${{ needs.build_sdist.outputs.SDIST_NAME }} matplotlib*
108+
109+ - name : Upload sdist result
110+ uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
111+ with :
112+ name : cibw-sdist-license
113+ path : dist/*.tar.gz
114+ if-no-files-found : error
115+
116+ build_wheels :
117+ needs : [build_sdist, sdist_license]
93118 name : Build wheels on ${{ matrix.os }} for ${{ matrix.cibw_archs }}
94119 runs-on : ${{ matrix.os }}
95120 env :
@@ -112,8 +137,7 @@ jobs:
112137 CIBW_MANYLINUX_X86_64_IMAGE : manylinux2014
113138 CIBW_SKIP : " *-musllinux_aarch64"
114139 CIBW_TEST_COMMAND : >-
115- python -m pip install build twine &&
116- twine check {wheel} &&
140+ python -m pip install build &&
117141 python {package}/ci/check_version_number.py
118142 MACOSX_DEPLOYMENT_TARGET : " 10.12"
119143 CIBW_TEST_ENVIRONMENT : PIP_PREFER_BINARY="1"
@@ -143,7 +167,7 @@ jobs:
143167 - name : Download sdist
144168 uses : actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
145169 with :
146- name : cibw-sdist
170+ name : cibw-sdist-license
147171 path : dist/
148172
149173 - name : Update LICENSE for binary distrobution
@@ -224,6 +248,11 @@ jobs:
224248 - name : Print out packages
225249 run : ls dist
226250
251+ - name : Run twine check
252+ run : |
253+ pip install twine
254+ twine check dist/*
255+
227256 - name : Generate artifact attestation for sdist and wheel
228257 uses : actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
229258 with :
0 commit comments