Skip to content

Commit d491065

Browse files
godlygeekGus Monod
authored and
Gus Monod
committed
ci: Restore steps performed only for releases
Also add a new step that runs unconditionally and requires that all of the cibuildwheel steps have succeeded, so that we can add just one required status check instead of N. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
1 parent 23ac740 commit d491065

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/build_wheels.yml

+18-2
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,21 @@ jobs:
133133
name: macosx_${{ matrix.cibw_arch }}-wheels
134134
path: ./wheelhouse/*.whl
135135

136+
build_and_test_wheels:
137+
name: Build and test wheels
138+
needs: [build_linux_wheels, build_macosx_wheels]
139+
runs-on: ubuntu-latest
140+
steps:
141+
# We can't make a matrix job itself a required check in GitHub,
142+
# so we instead add a job that depends on the two matrix jobs,
143+
# and we mark this job as required instead. This job doesn't do
144+
# any work, it just lets us better manage our required checks.
145+
- run: echo "Done!"
146+
136147
upload_pypi:
137-
needs: [build_linux_wheels, build_macosx_wheels, build_sdist]
148+
needs: [build_and_test_wheels, build_sdist]
138149
runs-on: ubuntu-latest
150+
if: github.event_name == 'release' && github.event.action == 'published'
139151
steps:
140152
- uses: actions/download-artifact@v4
141153
with:
@@ -146,7 +158,11 @@ jobs:
146158
mv dist/*-wheels/*.whl dist/
147159
rmdir dist/{sdist,*-wheels}
148160
rm -r dist/tests
149-
- run: ls -R dist
161+
ls -R dist
162+
- uses: pypa/gh-action-pypi-publish@release/v1
163+
with:
164+
skip_existing: true
165+
password: ${{ secrets.PYPI_PASSWORD }}
150166

151167
publish_docs:
152168
name: Publish docs

0 commit comments

Comments
 (0)