@@ -2,10 +2,11 @@ name: Build and Publish Python Wheels
2
2
3
3
on :
4
4
push :
5
- # branches: [ main ]
6
- # tags: [ 'v*' ]
5
+ branches : [ main ]
7
6
pull_request :
8
7
branches : [ main ]
8
+ release :
9
+ types : [published]
9
10
workflow_dispatch :
10
11
11
12
jobs :
24
25
uses : PyO3/maturin-action@v1
25
26
with :
26
27
args : --release --out dist --find-interpreter
27
- singlefile : true
28
28
29
29
- name : Upload wheels
30
30
uses : actions/upload-artifact@v4
46
46
uses : PyO3/maturin-action@v1
47
47
with :
48
48
args : --release --out dist --find-interpreter
49
- singlefile : true
50
49
51
50
- name : Upload wheels
52
51
uses : actions/upload-artifact@v4
68
67
uses : PyO3/maturin-action@v1
69
68
with :
70
69
args : --release --out dist --find-interpreter
71
- singlefile : true
72
70
73
71
- name : Upload wheels
74
72
uses : actions/upload-artifact@v4
88
86
target : x86_64-unknown-linux-gnu
89
87
manylinux : 2014
90
88
args : --release --out dist --find-interpreter
91
- singlefile : false
92
89
before-script-linux : |
93
90
# Install HDF5 development files
94
91
yum install -y hdf5-devel
@@ -103,26 +100,26 @@ jobs:
103
100
name : wheels-manylinux
104
101
path : dist/*.whl
105
102
106
- # publish:
107
- # name: Publish package
108
- # needs: [build_wheels_linux, build_wheels_macos, build_wheels_windows, build_manylinux]
109
- # runs-on: ubuntu-latest
110
- # if: startsWith( github.ref, 'refs/tags/v')
111
- # steps:
112
- # - uses: actions/download-artifact@v4
113
- # with:
114
- # path: dist
115
-
116
- # - name: Prepare distribution files
117
- # run: |
118
- # mkdir -p dist_combined
119
- # find dist -name "*.whl" -exec cp {} dist_combined \;
120
- # ls -la dist_combined/
121
-
122
- # - name: Publish to PyPI
123
- # uses: pypa/gh-action-pypi-publish@release/v1
124
- # with:
125
- # user: __token__
126
- # password: ${{ secrets.PYPI_API_TOKEN }}
127
- # packages-dir: dist_combined/
128
- # skip-existing: true
103
+ publish :
104
+ name : Publish package
105
+ needs : [build_wheels_linux, build_wheels_macos, build_wheels_windows, build_manylinux]
106
+ runs-on : ubuntu-latest
107
+ if : github.event_name == 'release' && github.event.action == 'published'
108
+ steps :
109
+ - uses : actions/download-artifact@v4
110
+ with :
111
+ path : dist
112
+
113
+ - name : Prepare distribution files
114
+ run : |
115
+ mkdir -p dist_combined
116
+ find dist -name "*.whl" -exec cp {} dist_combined \;
117
+ ls -la dist_combined/
118
+
119
+ - name : Publish to PyPI
120
+ uses : pypa/gh-action-pypi-publish@release/v1
121
+ with :
122
+ user : __token__
123
+ password : ${{ secrets.PYPI_API_TOKEN }}
124
+ packages-dir : dist_combined/
125
+ skip-existing : true
0 commit comments