Skip to content

Commit f9d545a

Browse files
authored
Create release.yml
1 parent 22af632 commit f9d545a

1 file changed

Lines changed: 110 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
linux:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
target: [x86_64, aarch64]
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Build wheels
21+
uses: PyO3/maturin-action@v1
22+
with:
23+
target: ${{ matrix.target }}
24+
args: --release --out dist --find-interpreter
25+
sccache: 'true'
26+
manylinux: auto
27+
28+
- name: Upload wheels
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: wheels-linux-${{ matrix.target }}
32+
path: dist
33+
34+
windows:
35+
runs-on: windows-latest
36+
strategy:
37+
matrix:
38+
target: [x64, x86]
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Build wheels
43+
uses: PyO3/maturin-action@v1
44+
with:
45+
target: ${{ matrix.target }}
46+
args: --release --out dist --find-interpreter
47+
sccache: 'true'
48+
49+
- name: Upload wheels
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: wheels-windows-${{ matrix.target }}
53+
path: dist
54+
55+
macos:
56+
runs-on: macos-latest
57+
strategy:
58+
matrix:
59+
target: [x86_64, aarch64]
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Build wheels
64+
uses: PyO3/maturin-action@v1
65+
with:
66+
target: ${{ matrix.target }}
67+
args: --release --out dist --find-interpreter
68+
sccache: 'true'
69+
70+
- name: Upload wheels
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: wheels-macos-${{ matrix.target }}
74+
path: dist
75+
76+
sdist:
77+
runs-on: ubuntu-latest
78+
steps:
79+
- uses: actions/checkout@v4
80+
81+
- name: Build sdist
82+
uses: PyO3/maturin-action@v1
83+
with:
84+
command: sdist
85+
args: --out dist
86+
87+
- name: Upload sdist
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: wheels-sdist
91+
path: dist
92+
93+
release:
94+
name: Release
95+
runs-on: ubuntu-latest
96+
needs: [linux, windows, macos, sdist]
97+
steps:
98+
- uses: actions/download-artifact@v4
99+
with:
100+
pattern: wheels-*
101+
path: dist
102+
merge-multiple: true
103+
104+
- name: Publish to PyPI
105+
uses: PyO3/maturin-action@v1
106+
env:
107+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
108+
with:
109+
command: upload
110+
args: --non-interactive --skip-existing dist/*

0 commit comments

Comments
 (0)