Skip to content

Commit dac3b97

Browse files
authored
Update pypi yml (#180)
* Update GitHub Actions to use latest versions of checkout, upload-artifact, and cibuildwheel * Update cibuildwheel * Update PyPI workflow to refine wheel and source distribution artifact handling * Refactor PyPI workflow to simplify matrix configuration and fix version typo in publish action * Comment out excluded OS and architecture configurations in PyPI workflow * Uncomment Python version cp312 in PyPI workflow matrix * Refactor PyPI workflow to enable all OS and architecture configurations in the build matrix * Update PyPI workflow to enable password usage for production and skip existing packages
1 parent 8685d84 commit dac3b97

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

.github/workflows/pypi.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
name: Build wheels on ${{ matrix.name }} (${{ matrix.python-version }} ${{ matrix.arch }})
1919
runs-on: ${{ matrix.os }}
2020
strategy:
21-
fail-fast: false
21+
fail-fast: true
2222
matrix:
2323
os: [ubuntu-latest, macos-latest, windows-latest]
2424
python-version: [cp39, cp310, cp311, cp312, cp313]
@@ -37,33 +37,35 @@ jobs:
3737
name: macOS
3838

3939
steps:
40-
- uses: actions/checkout@v4.0.0
40+
- uses: actions/checkout@v4
4141

4242
- name: Build wheels
43-
uses: pypa/cibuildwheel@v2.21.3
43+
uses: pypa/cibuildwheel@v3.0.1
4444
# to supply options, put them in 'env', like:
4545
env:
4646
MACOSX_DEPLOYMENT_TARGET: "11.0"
4747
CIBW_ARCHS: auto64
4848
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
4949
CIBW_BUILD: ${{ matrix.python-version }}-*
50-
CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *musllinux* *manylinux1* *-win32 *linux_i686 *linux_aarch64 *linux_ppc64le *linux_s390x"
50+
CIBW_SKIP: "cp38-* pp* *musllinux* *manylinux1* *-win32 *linux_i686 *linux_aarch64 *linux_ppc64le *linux_s390x"
5151

52-
- uses: actions/upload-artifact@v3
52+
- uses: actions/upload-artifact@v4
5353
with:
54+
name: wheelhouse-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.arch }}
5455
path: ./wheelhouse/*.whl
5556

5657
build_sdist:
5758
name: Build source distribution
5859
runs-on: ubuntu-latest
5960
steps:
60-
- uses: actions/checkout@v4.0.0
61+
- uses: actions/checkout@v4
6162

6263
- name: Build sdist
6364
run: pipx run build --sdist
6465

65-
- uses: actions/upload-artifact@v3
66+
- uses: actions/upload-artifact@v4
6667
with:
68+
name: sdist
6769
path: dist/*.tar.gz
6870

6971
upload_pypi:
@@ -75,18 +77,26 @@ jobs:
7577
# alternatively, to publish when a GitHub Release is created, use the following rule:
7678
# if: github.event_name == 'release' && github.event.action == 'published'
7779
steps:
78-
- uses: actions/download-artifact@v3
80+
- name: Download wheels
81+
uses: actions/download-artifact@v4
7982
with:
80-
# unpacks default artifact into dist/
81-
# if `name: artifact` is omitted, the action will create extra parent dir
82-
name: artifact
83+
pattern: wheelhouse-*
84+
merge-multiple: true
8385
path: dist
8486

85-
- uses: pypa/[email protected]
87+
- name: Download source distribution
88+
uses: actions/download-artifact@v4
89+
with:
90+
name: sdist
91+
merge-multiple: true
92+
path: dist
93+
94+
- uses: pypa/[email protected]
8695
with:
8796
user: __token__
8897
# To test:
89-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
90-
repository-url: https://test.pypi.org/legacy/
98+
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
99+
# repository-url: https://test.pypi.org/legacy/
91100
# To release:
92-
# password: ${{ secrets.PYPI_API_TOKEN }}
101+
password: ${{ secrets.PYPI_API_TOKEN }}
102+
skip-existing: true

0 commit comments

Comments
 (0)