Skip to content

Commit ece9415

Browse files
committed
trigger on release
1 parent 1e0d6a2 commit ece9415

File tree

1 file changed

+26
-29
lines changed

1 file changed

+26
-29
lines changed

.github/workflows/python-publish.yml

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ name: Build and Publish Python Wheels
22

33
on:
44
push:
5-
# branches: [ main ]
6-
# tags: [ 'v*' ]
5+
branches: [ main ]
76
pull_request:
87
branches: [ main ]
8+
release:
9+
types: [published]
910
workflow_dispatch:
1011

1112
jobs:
@@ -24,7 +25,6 @@ jobs:
2425
uses: PyO3/maturin-action@v1
2526
with:
2627
args: --release --out dist --find-interpreter
27-
singlefile: true
2828

2929
- name: Upload wheels
3030
uses: actions/upload-artifact@v4
@@ -46,7 +46,6 @@ jobs:
4646
uses: PyO3/maturin-action@v1
4747
with:
4848
args: --release --out dist --find-interpreter
49-
singlefile: true
5049

5150
- name: Upload wheels
5251
uses: actions/upload-artifact@v4
@@ -68,7 +67,6 @@ jobs:
6867
uses: PyO3/maturin-action@v1
6968
with:
7069
args: --release --out dist --find-interpreter
71-
singlefile: true
7270

7371
- name: Upload wheels
7472
uses: actions/upload-artifact@v4
@@ -88,7 +86,6 @@ jobs:
8886
target: x86_64-unknown-linux-gnu
8987
manylinux: 2014
9088
args: --release --out dist --find-interpreter
91-
singlefile: false
9289
before-script-linux: |
9390
# Install HDF5 development files
9491
yum install -y hdf5-devel
@@ -103,26 +100,26 @@ jobs:
103100
name: wheels-manylinux
104101
path: dist/*.whl
105102

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

Comments
 (0)