1+ name : CD
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+ python-version : ["3.7", "3.8", "3.9", "3.10"]
17+ target : [x86_64, x86, aarch64, armv7, s390x, ppc64le]
18+ steps :
19+ - uses : actions/checkout@v3
20+ - uses : actions/setup-python@v4
21+ with :
22+ python-version : ${{ matrix.python-version }}
23+ - name : Build wheels
24+ uses : PyO3/maturin-action@v1
25+ with :
26+ target : ${{ matrix.target }}
27+ args : --release --out dist --find-interpreter
28+ sccache : " true"
29+ manylinux : auto
30+ - name : Upload wheels
31+ uses : actions/upload-artifact@v3
32+ with :
33+ name : wheels-${{ matrix.python-version }}-${{ matrix.target }}
34+ path : dist
35+
36+ windows :
37+ runs-on : windows-latest
38+ strategy :
39+ matrix :
40+ python-version : ["3.7", "3.8", "3.9", "3.10"]
41+ target : [x64, x86]
42+ steps :
43+ - uses : actions/checkout@v3
44+ - uses : actions/setup-python@v4
45+ with :
46+ python-version : ${{ matrix.python-version }}
47+ architecture : ${{ matrix.target }}
48+ - name : Build wheels
49+ uses : PyO3/maturin-action@v1
50+ with :
51+ target : ${{ matrix.target }}
52+ args : --release --out dist --find-interpreter
53+ sccache : " true"
54+ - name : Upload wheels
55+ uses : actions/upload-artifact@v3
56+ with :
57+ name : wheels-${{ matrix.python-version }}-${{ matrix.target }}
58+ path : dist
59+
60+ macos :
61+ runs-on : macos-latest
62+ strategy :
63+ matrix :
64+ python-version : ["3.7", "3.8", "3.9", "3.10"]
65+ target : [x86_64, aarch64]
66+ steps :
67+ - uses : actions/checkout@v3
68+ - uses : actions/setup-python@v4
69+ with :
70+ python-version : " 3.10"
71+ - name : Build wheels
72+ uses : PyO3/maturin-action@v1
73+ with :
74+ target : ${{ matrix.target }}
75+ args : --release --out dist --find-interpreter
76+ sccache : " true"
77+ - name : Upload wheels
78+ uses : actions/upload-artifact@v3
79+ with :
80+ name : wheels-${{ matrix.python-version }}-${{ matrix.target }}
81+ path : dist
82+
83+ sdist :
84+ runs-on : ubuntu-latest
85+ steps :
86+ - uses : actions/checkout@v3
87+ - name : Build sdist
88+ uses : PyO3/maturin-action@v1
89+ with :
90+ command : sdist
91+ args : --out dist
92+ - name : Upload sdist
93+ uses : actions/upload-artifact@v3
94+ with :
95+ name : wheels
96+ path : dist
97+
98+ release :
99+ name : Release
100+ runs-on : ubuntu-latest
101+ needs : [linux, windows, macos, sdist]
102+ steps :
103+ - uses : actions/download-artifact@v3
104+ with :
105+ name : wheels
106+ - name : Publish to PyPI
107+ uses : PyO3/maturin-action@v1
108+ env :
109+ MATURIN_PYPI_TOKEN : ${{ secrets.PYPI_API_TOKEN }}
110+ with :
111+ command : upload
112+ args : --skip-existing *
0 commit comments