8000 upload to PyPI on create a release (#639) · msgpack/msgpack-python@fe9e620 · GitHub
[go: up one dir, main page]

Skip to content

Commit fe9e620

Browse files
authored
upload to PyPI on create a release (#639)
1 parent cdc7644 commit fe9e620

File tree

1 file changed

+45
-3
lines changed

1 file changed

+45
-3
lines changed

.githu 8000 b/workflows/wheel.yml

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
name: Build Wheels
1+
name: Build sdist and Wheels
22
on:
33
push:
44
branches: [main]
5-
create:
5+
release:
6+
types:
7+
- published
68
workflow_dispatch:
79

810
jobs:
@@ -34,7 +36,7 @@ jobs:
3436
CIBW_SKIP: "pp* cp38-macosx_*"
3537

3638
- name: Build sdist
37-
if: runner.os == 'Linux'
39+
if: runner.os == 'Linux' && runner.arch == 'X64'
3840
run: |
3941
pip install build
4042
python -m build -s -o wheelhouse
@@ -44,3 +46,43 @@ jobs:
4446
with:
4547
name: wheels-${{ matrix.os }}
4648
path: wheelhouse
49+
50+
# combine all wheels into one artifact
51+
combine_wheels:
52+
needs: [build_wheels]
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/download-artifact@v4
56+
with:
57+
# unpacks all CIBW artifacts into dist/
58+
pattern: wheels-*
59+
path: dist
60+
merge-multiple: true
61+
62+
- name: Upload Wheels to artifact
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: wheels-all
66+
path: dist
67+
68+
# https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
69+
upload_pypi:
70+
needs: [build_wheels]
71+
runs-on: ubuntu-latest
72+
environment: pypi
73+
permissions:
74+
id-token: write
75+
if: github.event_name == 'release' && github.event.action == 'published'
76+
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
77+
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
78+
steps:
79+
- uses: actions/download-artifact@v4
80+
with:
81+
# unpacks all CIBW artifacts into dist/
82+
pattern: wheels-*
83+
path: dist
84+
merge-multiple: true
85+
86+
- uses: pypa/gh-action-pypi-publish@release/v1
87+
#with:
88+
# To test: repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)
0