Commit c38bf3f 1 parent 05cd87f commit c38bf3f Copy full SHA for c38bf3f
File tree 1 file changed +41
-6
lines changed
1 file changed +41
-6
lines changed Original file line number Diff line number Diff line change 1
- name : Upload Python Package
1
+ name : Build Python wheels
2
2
3
3
on :
4
+ push :
5
+ branches :
6
+ - main
4
7
release :
5
8
types : [published]
6
9
7
10
permissions :
8
11
contents : read
9
12
10
13
jobs :
11
- deploy :
14
+ build_wheels :
12
15
runs-on : ${{ matrix.os }}
13
16
strategy :
14
17
matrix :
@@ -27,12 +30,44 @@ jobs:
27
30
python -m pip install --upgrade pip
28
31
pip install build cibuildwheel==2.20.0
29
32
30
- - name : Build package
33
+ - name : Build wheels
31
34
run : python -m cibuildwheel
32
35
33
- - name : Publish package
34
- uses : pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0
36
+ - uses : actions/upload-artifact@v4
37
+ with :
38
+ name : cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
39
+ path : ./wheelhouse/*.whl
40
+
41
+ build_sdist :
42
+ name : Build source distribution
43
+ runs-on : ubuntu-latest
44
+ steps :
45
+ - uses : actions/checkout@v4
46
+
47
+ - name : Build sdist
48
+ run : pipx run build --sdist
49
+
50
+ - uses : actions/upload-artifact@v4
51
+ with :
52
+ name : cibw-sdist
53
+ path : dist/*.tar.gz
54
+
55
+ upload_pypi :
56
+ needs : [build_wheels, build_sdist]
57
+ runs-on : ubuntu-latest
58
+ environment : pypi
59
+ permissions :
60
+ id-token : write
61
+ if : github.event_name == 'release' && github.event.action == 'published'
62
+
63
+ steps :
64
+ - uses : actions/download-artifact@v4
65
+ with :
66
+ pattern : cibw-*
67
+ path : dist
68
+ merge-multiple : true
69
+
70
+ - uses : pypa/gh-action-pypi-publish@release/v1
35
71
with :
36
72
user : __token__
37
73
password : ${{ secrets.PYPI_API_TOKEN }}
38
- packages_dir : ./wheelhouse/
You can’t perform that action at this time.
0 commit comments