Skip to content

Commit be1f35f

Browse files
committed
add CI for release to pypi
1 parent baa5493 commit be1f35f

File tree

1 file changed

+169
-0
lines changed

1 file changed

+169
-0
lines changed

.github/workflows/CI.yml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
# This file is autogenerated by maturin v1.7.1
2+
# To update, run
3+
#
4+
# maturin generate-ci github
5+
#
6+
name: CI
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
tags:
13+
- '*'
14+
pull_request:
15+
workflow_dispatch:
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
linux:
22+
runs-on: ${{ matrix.platform.runner }}
23+
strategy:
24+
matrix:
25+
platform:
26+
- runner: ubuntu-latest
27+
target: x86_64
28+
- runner: ubuntu-latest
29+
target: x86
30+
- runner: ubuntu-latest
31+
target: aarch64
32+
- runner: ubuntu-latest
33+
target: armv7
34+
- runner: ubuntu-latest
35+
target: s390x
36+
- runner: ubuntu-latest
37+
target: ppc64le
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: actions/setup-python@v5
41+
with:
42+
python-version: 3.x
43+
- name: Build wheels
44+
uses: PyO3/maturin-action@v1
45+
with:
46+
target: ${{ matrix.platform.target }}
47+
args: --release --out dist --find-interpreter
48+
sccache: 'true'
49+
manylinux: auto
50+
- name: Upload wheels
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: wheels-linux-${{ matrix.platform.target }}
54+
path: dist
55+
56+
musllinux:
57+
runs-on: ${{ matrix.platform.runner }}
58+
strategy:
59+
matrix:
60+
platform:
61+
- runner: ubuntu-latest
62+
target: x86_64
63+
- runner: ubuntu-latest
64+
target: x86
65+
- runner: ubuntu-latest
66+
target: aarch64
67+
- runner: ubuntu-latest
68+
target: armv7
69+
steps:
70+
- uses: actions/checkout@v4
71+
- uses: actions/setup-python@v5
72+
with:
73+
python-version: 3.x
74+
- name: Build wheels
75+
uses: PyO3/maturin-action@v1
76+
with:
77+
target: ${{ matrix.platform.target }}
78+
args: --release --out dist --find-interpreter
79+
sccache: 'true'
80+
manylinux: musllinux_1_2
81+
- name: Upload wheels
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: wheels-musllinux-${{ matrix.platform.target }}
85+
path: dist
86+
87+
windows:
88+
runs-on: ${{ matrix.platform.runner }}
89+
strategy:
90+
matrix:
91+
platform:
92+
- runner: windows-latest
93+
target: x64
94+
- runner: windows-latest
95+
target: x86
96+
steps:
97+
- uses: actions/checkout@v4
98+
- uses: actions/setup-python@v5
99+
with:
100+
python-version: 3.x
101+
architecture: ${{ matrix.platform.target }}
102+
- name: Build wheels
103+
uses: PyO3/maturin-action@v1
104+
with:
105+
target: ${{ matrix.platform.target }}
106+
args: --release --out dist --find-interpreter
107+
sccache: 'true'
108+
- name: Upload wheels
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: wheels-windows-${{ matrix.platform.target }}
112+
path: dist
113+
114+
macos:
115+
runs-on: ${{ matrix.platform.runner }}
116+
strategy:
117+
matrix:
118+
platform:
119+
- runner: macos-12
120+
target: x86_64
121+
- runner: macos-14
122+
target: aarch64
123+
steps:
124+
- uses: actions/checkout@v4
125+
- uses: actions/setup-python@v5
126+
with:
127+
python-version: 3.x
128+
- name: Build wheels
129+
uses: PyO3/maturin-action@v1
130+
with:
131+
target: ${{ matrix.platform.target }}
132+
args: --release --out dist --find-interpreter
133+
sccache: 'true'
134+
- name: Upload wheels
135+
uses: actions/upload-artifact@v4
136+
with:
137+
name: wheels-macos-${{ matrix.platform.target }}
138+
path: dist
139+
140+
sdist:
141+
runs-on: ubuntu-latest
142+
steps:
143+
- uses: actions/checkout@v4
144+
- name: Build sdist
145+
uses: PyO3/maturin-action@v1
146+
with:
147+
command: sdist
148+
args: --out dist
149+
- name: Upload sdist
150+
uses: actions/upload-artifact@v4
151+
with:
152+
name: wheels-sdist
153+
path: dist
154+
155+
release:
156+
name: Release
157+
runs-on: ubuntu-latest
158+
environment: release
159+
if: "startsWith(github.ref, 'refs/tags/')"
160+
needs: [linux, musllinux, windows, macos, sdist]
161+
permissions:
162+
id-token: write
163+
steps:
164+
- uses: actions/download-artifact@v4
165+
- name: Publish to PyPI
166+
uses: PyO3/maturin-action@v1
167+
with:
168+
command: upload
169+
args: --non-interactive --skip-existing wheels-*/*

0 commit comments

Comments
 (0)