Skip to content

Commit c0e435c

Browse files
committed
Update upload_to_pypi.yml
1 parent 0bc5722 commit c0e435c

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/upload_to_pypi.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ name: Build and upload to PyPI
22

33
on:
44
release:
5-
types: [published]
5+
types: [published, edited]
6+
push:
7+
# branches:
8+
# - main
69

710
jobs:
811
build_wheels:
@@ -17,18 +20,17 @@ jobs:
1720

1821
- uses: actions/setup-python@v5
1922
name: Install Python
20-
with:
21-
python-version: '3.x'
2223

2324
- name: Build wheels
2425
# For very recent Python versions, wheels from e.g. numpy might not be
2526
# available yet which can cause the build to fail. Keep going, and upload
2627
# the wheels for all of the previous versions when that happens.
2728
continue-on-error: true
28-
uses: pypa/cibuildwheel@v2.20.0
29+
uses: pypa/cibuildwheel@v2.22.0
2930

3031
- uses: actions/upload-artifact@v4
3132
with:
33+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
3234
path: ./wheelhouse/*.whl
3335

3436
build_sdist:
@@ -39,8 +41,6 @@ jobs:
3941

4042
- uses: actions/setup-python@v5
4143
name: Install Python
42-
with:
43-
python-version: '3.x'
4444

4545
- name: Install build
4646
run: python -m pip install build
@@ -50,17 +50,22 @@ jobs:
5050

5151
- uses: actions/upload-artifact@v4
5252
with:
53+
name: cibw-sdist
5354
path: dist/*.tar.gz
5455

5556
upload_pypi:
5657
name: Upload to PyPI
5758
needs: [build_wheels, build_sdist]
5859
runs-on: ubuntu-latest
60+
permissions:
61+
id-token: write
62+
if: startsWith(github.ref, 'refs/tags/v')
5963
steps:
6064
- uses: actions/download-artifact@v4
6165
with:
62-
name: artifact
63-
path: dist
66+
pattern: cibw-*
67+
path: dist
68+
merge-multiple: true
6469

6570
- uses: pypa/gh-action-pypi-publish@release/v1
6671
with:

0 commit comments

Comments
 (0)