Skip to content

Building and Releasing

STKCraft edited this page Nov 12, 2026 · 2 revisions

Building and releasing

Toolchain

  • Rust 1.75 or newer (MSRV, checked in CI).
  • Edition 2021.
  • No build script, no C toolchain, no external system libraries.
cargo build
cargo build --features mcp
cargo build --no-default-features          # no_std + alloc

Test matrix

cargo fmt --all -- --check
cargo test --all-targets
cargo test --all-targets --features mcp
cargo clippy --all-targets -- -D warnings
cargo clippy --all-targets --features mcp -- -D warnings
cargo build --no-default-features
cargo build --no-default-features --target wasm32-unknown-unknown
cargo build --no-default-features --target thumbv7em-none-eabi
cargo build --release --features mcp --bins
cargo test --release --features mcp
cargo +1.75.0 check --all-targets --features mcp
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features

The same commands run in CI on pushes and tags.

Validation scripts

Offline (committed data):

cargo test --test spice_golden        # 82 CSPICE vectors
cargo test --test version_sync        # documented versions match Cargo.toml
cargo test --test api_index           # public API index matches src/

tests/api_index.rs parses every pub item in src/*.rs and requires a matching entry in the docs/API.md index. Adding a public item without documenting it fails the build, and so does leaving a removed item in the index; the failure lists the exact names.

Against external references (needs network or local data):

python tools/validate_sclk.py --sclk target/mro_sclk.tsc --id -74 --lsk src/naif0012.tls
python tools/validate_ut1.py --eop data/finals2000A.all
python tools/validate_ut1_astropy.py
python tools/wgc2_compare.py
python tools/wgc2_kernel_sweep.py --insecure    # only if TLS verification fails

Regenerating committed data:

python tools/gen_golden.py
python tools/gen_tcg_tcb_golden.py
python tools/gen_dtdb_golden.py
python tools/gen_dtdb_table.py        # verifies the pinned SHA-256

See Verification for what each check establishes.

Versioning

Semantic versioning, with a patch bump for every update while the major version is 0:

  1. Increment the patch component.
  2. Update Cargo.toml, Cargo.lock, CITATION.cff, the README, the API guide and the issue template.
  3. Add a dated CHANGELOG.md section (never [Unreleased]).
  4. Add docs/releases/vX.Y.Z.md, which becomes the release body.

tests/version_sync.rs fails the build if any of those files still names a different version, and requires install snippets to pin the exact release.

Release flow

A tag performs all publishing steps:

  1. CI is green on main.
  2. Annotated tag vX.Y.Z is pushed.
  3. The Release workflow builds release binaries for Linux, macOS (x86_64 and arm64) and Windows, writes SHA256SUMS.txt, and creates the GitHub Release from docs/releases/vX.Y.Z.md.
  4. The same workflow runs cargo publish when the CARGO_REGISTRY_TOKEN repository secret is set. It skips when the secret is absent and when the version already exists, so a re-run is safe.
  5. docs.rs picks up the crate from crates.io and builds the API reference.

Publication channels

Channel Artifact
crates.io the library and the source
GitHub Releases release-mode binaries and checksums
docs.rs API reference

GitHub Packages has no Cargo registry, so the crate itself is not mirrored there. No container image is published.

Contributing

  • Keep every file in English.
  • Keep the design invariants in Design and non-goals.
  • Add a test for every behaviour change; boundary cases belong in tests/.
  • Run the full matrix before opening a pull request.

Clone this wiki locally