@@ -18,69 +18,59 @@ jobs:
18
18
steps :
19
19
- uses : actions/checkout@v4
20
20
21
- - uses : actions/setup-python@v5
22
- with :
23
- python-version : ' 3.12'
24
-
25
- - name : Install cibuildwheel
26
- run : python -m pip install cibuildwheel==2.16.2
27
-
28
- - name : Build wheels for Linux
29
- if : matrix.os == 'ubuntu-latest'
30
- run : |
31
- python -m cibuildwheel --output-dir wheelhouse
32
- env :
33
- CIBW_SKIP : " pp* *i686* *musllinux*"
34
- CIBW_PROJECT_REQUIRES_PYTHON : " >=3.8"
35
- CIBW_BEFORE_BUILD : pip install --verbose --editable .
36
-
37
- - name : Build wheels for Windows
38
- if : matrix.os == 'windows-latest'
39
- run : |
40
- python -m cibuildwheel --output-dir wheelhouse
41
- env :
42
- CIBW_SKIP : " pp* *i686* *win32"
43
- CIBW_PROJECT_REQUIRES_PYTHON : " >=3.8"
44
- CIBW_BEFORE_BUILD : pip install --verbose --editable .
45
-
46
- - name : Build wheels for macOS
47
- if : matrix.os == 'macos-latest'
48
- run : |
49
- python -m cibuildwheel --output-dir wheelhouse
21
+ - name : Build wheels
22
+
50
23
env :
51
- CIBW_ARCHS_MACOS : " x86_64 universal2 arm64 "
52
- CIBW_SKIP : " pp* *i686*"
24
+ CIBW_BUILD : cp3*-*
25
+ CIBW_SKIP : pp* *i686* *win32 *musllinux*
53
26
CIBW_PROJECT_REQUIRES_PYTHON : " >=3.8"
54
27
CIBW_BEFORE_BUILD : pip install --verbose --editable .
28
+ CIBW_ARCHS_LINUX : auto64
29
+ CIBW_ARCHS_MACOS : x86_64 universal2 arm64
30
+ CIBW_ARCHS_WINDOWS : auto64
55
31
56
32
- uses : actions/upload-artifact@v4
57
33
with :
58
- name : ${{ matrix.os }}-artifact
34
+ name : artifact-wheels- ${{ matrix.os }}
59
35
path : ./wheelhouse/*.whl
60
36
37
+ build_sdist :
38
+ name : Build source distribution
39
+ runs-on : ubuntu-latest
40
+ steps :
41
+ - uses : actions/checkout@v4
42
+
43
+ - uses : actions/setup-python@v5
44
+ name : Install Python
45
+ with :
46
+ python-version : ' 3.12'
47
+
48
+ - run : pip install build
49
+
50
+ - name : Build sdist
51
+ run : python -m build --sdist
52
+
53
+ - uses : actions/upload-artifact@v4
54
+ with :
55
+ name : artifact-source
56
+ path : dist/*.tar.gz
57
+
61
58
upload_pypi :
62
- needs : build_wheels
59
+ needs : [ build_wheels, build_sdist]
63
60
runs-on : ubuntu-latest
64
61
65
62
if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
66
63
steps :
67
- - uses : actions/checkout@v4
68
-
69
64
- uses : actions/download-artifact@v4
70
65
with :
71
- name : artifact
72
66
path : dist
67
+ pattern : artifact-*
68
+ merge-multiple : true
73
69
74
- - name : Install dependencies
75
- run : |
76
- python -m pip install --upgrade pip
77
- pip install build
78
- pip install twine
79
-
80
- - name : Publish
81
- env :
82
- TWINE_USERNAME : __token__
83
- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
84
- run : |
85
- python -m build --sdist
86
- twine upload dist/*
70
+
71
+ with :
72
+ user : __token__
73
+ password : ${{ secrets.PYPI_PASSWORD }}
74
+ # To test, uncomment the following:
75
+ # password: ${{ secrets.TEST_PYPI_PASSWORD }}
76
+ # repository-url: https://test.pypi.org/legacy/
0 commit comments