@@ -58,10 +58,34 @@ jobs:
5858 pip --disable-pip-version-check install -e .
5959 pip --disable-pip-version-check install -r docs/requirements.txt
6060 cd docs && make clean html SPHINXOPTS="-W --keep-going"
61-
61+
62+ build :
63+ runs-on : ubuntu-22.04
64+ steps :
65+ - uses : actions/checkout@v3
66+ with :
67+ submodules : recursive
68+ fetch-depth : 0
69+
70+ - uses : actions/setup-python@v4
71+ with :
72+ python-version : 3.8
73+
74+ - name : Install build
75+ run : python -m pip --disable-pip-version-check install build
76+
77+ - name : Build sdist + wheel
78+ run : python -m build
79+
80+ - name : Upload build artifacts
81+ uses : actions/upload-artifact@v3
82+ with :
83+ name : dist
84+ path : dist
85+
6286 test :
6387 runs-on : ${{ matrix.os }}
64- needs : [setup_concurrency]
88+ needs : [setup_concurrency, build ]
6589 strategy :
6690 max-parallel : ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
6791 matrix :
@@ -88,6 +112,12 @@ jobs:
88112 with :
89113 python-version : ${{ matrix.python_version }}
90114 architecture : ${{ matrix.architecture }}
115+
116+ - name : Download build artifacts
117+ uses : actions/download-artifact@v3
118+ with :
119+ name : dist
120+ path : dist
91121
92122 - name : Set ccache variant
93123 shell : bash
@@ -105,12 +135,6 @@ jobs:
105135 key : ${{ matrix.os }}-${{ matrix.architecture }}-${{ matrix.python_version }}
106136 variant : ${{ steps.ccache.outputs.variant }}
107137
108- - name : Install build
109- run : python -m pip --disable-pip-version-check install build
110-
111- - name : Build wheel
112- run : python -m build --wheel
113-
114138 - name : Install
115139 shell : bash
116140 working-directory : dist
@@ -133,7 +157,7 @@ jobs:
133157
134158 cross-build :
135159 runs-on : ubuntu-latest
136- needs : [setup_concurrency]
160+ needs : [setup_concurrency, build ]
137161 strategy :
138162 max-parallel : ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
139163 matrix :
@@ -155,11 +179,11 @@ jobs:
155179 with :
156180 key : ${{ matrix.container }}
157181
158- - name : Install build
159- run : /build/venv/bin/build-pip --disable-pip-version-check install build
160-
161- - name : Build wheel
162- run : /build/venv/bin/build-python -m build --wheel
182+ - name : Download build artifacts
183+ uses : actions/download-artifact@v3
184+ with :
185+ name : dist
186+ path : dist
163187
164188 - name : Install
165189 working-directory : dist
@@ -168,6 +192,14 @@ jobs:
168192 /build/venv/bin/build-pip --disable-pip-version-check install *.whl
169193 /build/venv/bin/cross-pip --disable-pip-version-check install *.whl
170194
195+ - name : Install test dependencies
196+ shell : bash
197+ working-directory : tests
198+ run : |
199+ # install to both cross and build in case things get mixed up
200+ /build/venv/bin/build-pip --disable-pip-version-check install -r requirements.txt
201+ /build/venv/bin/cross-pip --disable-pip-version-check install -r requirements.txt
202+
171203 - name : Build cross wheel
172204 env :
173205 RPYBUILD_PARALLEL : 1
@@ -179,22 +211,16 @@ jobs:
179211 publish :
180212 runs-on : ubuntu-latest
181213 needs : [check, check-doc, test]
214+ permissions :
215+ id-token : write
182216 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
183217
184218 steps :
185- - uses : actions/checkout@v3
219+ - name : Download build artifacts
220+ uses : actions/download-artifact@v3
186221 with :
187- submodules : true
188-
189- - uses : actions/setup-python@v4
190-
191- - run : pip --disable-pip-version-check install build
192-
193- - name : Build packages
194- run : python -m build
222+ name : dist
223+ path : dist
195224
196225 - name : Publish to PyPI
197- uses : pypa/gh-action-pypi-publish@master
198- with :
199- user : __token__
200- password : ${{ secrets.pypi_password }}
226+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments