Skip to content

Commit 3839d65

Browse files
committed
first commit
0 parents  commit 3839d65

102 files changed

Lines changed: 21794 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build:
16+
name: Build documentation
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.10"
23+
- uses: astral-sh/setup-uv@v4
24+
with:
25+
enable-cache: true
26+
- name: Sync documentation dependencies
27+
run: uv sync --locked --group doc
28+
- name: Generate API reference stubs
29+
run: cargo run --bin stub_gen
30+
- name: Build documentation
31+
run: uv run --locked --group doc zensical build --strict
32+
- name: Upload Pages artifact
33+
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
34+
uses: actions/upload-pages-artifact@v3
35+
with:
36+
path: site
37+
38+
deploy:
39+
name: Deploy GitHub Pages
40+
runs-on: ubuntu-latest
41+
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
42+
needs: build
43+
permissions:
44+
pages: write
45+
id-token: write
46+
concurrency:
47+
group: pages
48+
cancel-in-progress: false
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
steps:
53+
- name: Deploy Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

.github/workflows/lint-test.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Lint and Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
17+
jobs:
18+
python:
19+
name: Python
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.10"
26+
- uses: astral-sh/setup-uv@v4
27+
with:
28+
enable-cache: true
29+
- name: Ruff
30+
run: uv run --locked ruff check .
31+
- name: Pyright
32+
run: uv run --locked pyright tests examples
33+
- name: Python tests
34+
run: uv run --locked python -m unittest discover
35+
36+
rust:
37+
name: Rust
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: actions/setup-python@v5
42+
with:
43+
python-version: "3.10"
44+
- name: Cargo check
45+
run: cargo check --all-targets
46+
- name: Cargo clippy
47+
run: cargo clippy --all-targets -- -D warnings
48+
- name: Cargo tests
49+
run: cargo test --all-targets

.github/workflows/release.yml

Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
env:
13+
CARGO_TERM_COLOR: always
14+
15+
jobs:
16+
linux:
17+
name: Linux ${{ matrix.manylinux }} ${{ matrix.target }} py${{ matrix.python.version }}
18+
runs-on: ubuntu-22.04
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
python:
23+
- version: "3.10"
24+
tag: cp310
25+
- version: "3.11"
26+
tag: cp311
27+
- version: "3.12"
28+
tag: cp312
29+
- version: "3.13"
30+
tag: cp313
31+
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
32+
manylinux: [auto]
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ matrix.python.version }}
38+
- name: Build wheel
39+
uses: PyO3/maturin-action@v1
40+
with:
41+
target: ${{ matrix.target }}
42+
manylinux: ${{ matrix.manylinux }}
43+
args: --release --out dist --interpreter python${{ matrix.python.version }}
44+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
45+
- name: Upload wheel
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: wheels-linux-${{ matrix.manylinux }}-${{ matrix.target }}-${{ matrix.python.tag }}
49+
path: dist
50+
if-no-files-found: error
51+
52+
musllinux:
53+
name: Linux musllinux ${{ matrix.target }} py${{ matrix.python.version }}
54+
runs-on: ubuntu-22.04
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
python:
59+
- version: "3.10"
60+
tag: cp310
61+
- version: "3.11"
62+
tag: cp311
63+
- version: "3.12"
64+
tag: cp312
65+
- version: "3.13"
66+
tag: cp313
67+
target: [x86_64, x86, aarch64, armv7]
68+
steps:
69+
- uses: actions/checkout@v4
70+
- uses: actions/setup-python@v5
71+
with:
72+
python-version: ${{ matrix.python.version }}
73+
- name: Build wheel
74+
uses: PyO3/maturin-action@v1
75+
with:
76+
target: ${{ matrix.target }}
77+
manylinux: musllinux_1_2
78+
args: --release --out dist --interpreter python${{ matrix.python.version }}
79+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
80+
- name: Upload wheel
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: wheels-musllinux-${{ matrix.target }}-${{ matrix.python.tag }}
84+
path: dist
85+
if-no-files-found: error
86+
87+
windows:
88+
name: Windows ${{ matrix.target }} py${{ matrix.python.version }}
89+
runs-on: ${{ matrix.runner }}
90+
strategy:
91+
fail-fast: false
92+
matrix:
93+
include:
94+
- runner: windows-latest
95+
target: x64
96+
python:
97+
architecture: x64
98+
version: "3.10"
99+
tag: cp310
100+
- runner: windows-latest
101+
target: x64
102+
python:
103+
architecture: x64
104+
version: "3.11"
105+
tag: cp311
106+
- runner: windows-latest
107+
target: x64
108+
python:
109+
architecture: x64
110+
version: "3.12"
111+
tag: cp312
112+
- runner: windows-latest
113+
target: x64
114+
python:
115+
architecture: x64
116+
version: "3.13"
117+
tag: cp313
118+
- runner: windows-latest
119+
target: x86
120+
python:
121+
architecture: x86
122+
version: "3.10"
123+
tag: cp310
124+
- runner: windows-latest
125+
target: x86
126+
python:
127+
architecture: x86
128+
version: "3.11"
129+
tag: cp311
130+
- runner: windows-latest
131+
target: x86
132+
python:
133+
architecture: x86
134+
version: "3.12"
135+
tag: cp312
136+
- runner: windows-latest
137+
target: x86
138+
python:
139+
architecture: x86
140+
version: "3.13"
141+
tag: cp313
142+
- runner: windows-11-arm
143+
target: aarch64
144+
python:
145+
architecture: arm64
146+
version: "3.11"
147+
tag: cp311
148+
- runner: windows-11-arm
149+
target: aarch64
150+
python:
151+
architecture: arm64
152+
version: "3.12"
153+
tag: cp312
154+
- runner: windows-11-arm
155+
target: aarch64
156+
python:
157+
architecture: arm64
158+
version: "3.13"
159+
tag: cp313
160+
steps:
161+
- uses: actions/checkout@v4
162+
- uses: actions/setup-python@v5
163+
with:
164+
python-version: ${{ matrix.python.version }}
165+
architecture: ${{ matrix.python.architecture }}
166+
- name: Build wheel
167+
uses: PyO3/maturin-action@v1
168+
with:
169+
target: ${{ matrix.target }}
170+
args: --release --out dist --interpreter python
171+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
172+
- name: Upload wheel
173+
uses: actions/upload-artifact@v4
174+
with:
175+
name: wheels-windows-${{ matrix.target }}-${{ matrix.python.tag }}
176+
path: dist
177+
if-no-files-found: error
178+
179+
macos:
180+
name: macOS ${{ matrix.platform.target }} py${{ matrix.python.version }}
181+
runs-on: ${{ matrix.platform.runner }}
182+
strategy:
183+
fail-fast: false
184+
matrix:
185+
python:
186+
- version: "3.10"
187+
tag: cp310
188+
- version: "3.11"
189+
tag: cp311
190+
- version: "3.12"
191+
tag: cp312
192+
- version: "3.13"
193+
tag: cp313
194+
platform:
195+
- runner: macos-13
196+
target: x86_64
197+
- runner: macos-14
198+
target: aarch64
199+
steps:
200+
- uses: actions/checkout@v4
201+
- uses: actions/setup-python@v5
202+
with:
203+
python-version: ${{ matrix.python.version }}
204+
- name: Build wheel
205+
uses: PyO3/maturin-action@v1
206+
with:
207+
target: ${{ matrix.platform.target }}
208+
args: --release --out dist --interpreter python
209+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
210+
- name: Upload wheel
211+
uses: actions/upload-artifact@v4
212+
with:
213+
name: wheels-macos-${{ matrix.platform.target }}-${{ matrix.python.tag }}
214+
path: dist
215+
if-no-files-found: error
216+
217+
sdist:
218+
name: Source distribution
219+
runs-on: ubuntu-latest
220+
steps:
221+
- uses: actions/checkout@v4
222+
- name: Build sdist
223+
uses: PyO3/maturin-action@v1
224+
with:
225+
command: sdist
226+
args: --out dist
227+
- name: Upload sdist
228+
uses: actions/upload-artifact@v4
229+
with:
230+
name: sdist
231+
path: dist
232+
if-no-files-found: error
233+
234+
publish:
235+
name: Publish to PyPI
236+
runs-on: ubuntu-latest
237+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
238+
needs: [linux, musllinux, windows, macos, sdist]
239+
permissions:
240+
contents: read
241+
id-token: write
242+
steps:
243+
- uses: actions/download-artifact@v4
244+
with:
245+
path: dist
246+
merge-multiple: true
247+
- uses: astral-sh/setup-uv@v4
248+
- name: Publish distributions
249+
run: uv publish dist/*

0 commit comments

Comments
 (0)