set shell := ["bash", "-eu", "-o", "pipefail", "-c"]
py_versions := "3.12 3.13 3.14"

# maturin run through uv, with the `zig` extra so cross-compilation always works
# regardless of what's installed on the host.
maturin := "uv tool run --from 'maturin[zig]' maturin"

default:
    @just --list

build-linux:
    {{maturin}} build --release --interpreter python3.11 python3.12 python3.13 python3.14 --out dist

build-mac:
    {{maturin}} build --release --zig --target aarch64-apple-darwin --interpreter python3.11 python3.12 python3.13 python3.14 --out dist

# Build every wheel (Linux + macOS) plus the source distribution.
build-all: build-linux build-mac sdist

# Build the source distribution.
sdist:
    {{maturin}} sdist --out dist

# Push every artifact in dist/ to PyPI (auth via UV_PUBLISH_TOKEN, as in CI).
publish:
    uv publish dist/*

# Build everything and publish it in one step.
release: build-all publish

# Remove build artifacts.
clean:
    rm -rf dist target/wheels
