Skip to content

Commit 4d9293d

Browse files
committed
make wheel workflow triggerable manually
1 parent 407d42c commit 4d9293d

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

.github/workflows/build.yaml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
name: publish-pypi
1+
name: build-wheels
22

33
on:
44
push:
5+
branches:
6+
- main
57
tags:
6-
- 'v*'
8+
- 'v*'
9+
workflow_dispatch:
710

811
jobs:
912
linux-wheels:
@@ -92,7 +95,7 @@ jobs:
9295
name: windows-${{ matrix.python-version }}-wheel
9396
path: target/wheels
9497

95-
push:
98+
collect-wheels:
9699
needs: [osx-wheels, windows-wheels, linux-wheels]
97100
runs-on: ubuntu-latest
98101
steps:
@@ -121,8 +124,24 @@ jobs:
121124
- run: mv ./windows-3.8-wheel/* wheels
122125
- run: mv ./windows-3.7-wheel/* wheels
123126

127+
- name: Upload wheels as artifact
128+
uses: actions/upload-artifact@v4
129+
with:
130+
name: all-wheels
131+
path: wheels/
132+
retention-days: 7
133+
134+
publish-pypi:
135+
needs: [collect-wheels]
136+
runs-on: ubuntu-latest
137+
if: startsWith(github.ref, 'refs/tags/v')
138+
steps:
139+
- uses: actions/download-artifact@v4
140+
with:
141+
name: all-wheels
142+
path: wheels/
124143

125-
- name: Publish a Python distribution to PyPI
144+
- name: Publish to PyPI
126145
uses: pypa/gh-action-pypi-publish@release/v1
127146
with:
128147
password: ${{ secrets.PYPI }}

0 commit comments

Comments
 (0)