-
Notifications
You must be signed in to change notification settings - Fork 0
Publishing
TypeBit ships as one crate (typebit). CI verifies the exact artifact
before anything merges; a tag triggers the publish workflow.
- Create a crates.io API token: https://crates.io/settings/tokens
(scope
publish-new/publish-update). - Add it as a repository secret
CARGO_REGISTRY_TOKEN: Settings → Secrets and variables → Actions → New repository secret.
# 1. Bump the version in Cargo.toml (keep the changelog honest).
# 2. Commit, push to main (CI runs the full matrix).
# 3. Tag with a leading 'v' and push:
git tag v0.1.7
git push origin v0.1.7The publish workflow (.github/workflows/publish.yml) then:
- checks out the tag,
- runs
cargo package(the same artifact that gets published), - runs
cargo publishwith the token.
cargo fmt --check-
clippy -D warningson:no-default-features,std,std,ffi,--all-features— on Linux, Windows and macOS -
cargo test --all-featuresandcargo test --no-default-features(realno_stdcode-path execution, not just a compile check) -
cargo doc --all-features(rustdoc must build) + doc tests - bare-metal
no_stdtargets:aarch64-unknown-none,thumbv7em-none-eabihf,riscv32imac-unknown-none-elf - MSRV 1.95 (
cargo checkwith Rust 1.95) -
cargo-auditagainstCargo.lock -
cargo package+cargo package --list
Cargo.toml include ships src/**, README.md, LICENSE, docs/**
(the wiki lives in-repo and ships with the crate) and examples/**.
cargo package --list # inspect the tarball contents
cargo package # build + verify the exact artifact[package.metadata.docs.rs] in Cargo.toml builds docs with
--all-features and --cfg docsrs, so the FFI symbols, StdHost and the
feature-gated modules all render (with doc(cfg) badges). Every public item
has /// docs (#![warn(missing_docs)]); the CI doc job fails the build
if any intra-doc link breaks.
The wiki pages live in-repo under docs/wiki/ (they ship with the crate).
The GitHub Wiki is a separate git repository (<owner>/<repo>.wiki.git),
so the pages must be pushed to it explicitly — they are NOT updated by
pushing to the main repo.
Two ways to sync:
-
CI (automatic) —
.github/workflows/wiki-sync.ymlchecks out the wiki viaactions/checkoutand mirrorsdocs/wiki/into it on every change todocs/wiki/**. It uses the automaticGITHUB_TOKEN(grantedcontents: write, which covers wiki pushes) with no extra setup. If your fork/org blocks that, set a fine-grained PAT with "Read and write" wiki access as theGH_PATsecret — the workflow falls back to it automatically. -
Local script (manual) —
scripts/sync-wiki.ps1orscripts/sync-wiki.sh(needs theghCLI, authenticated).
./scripts/sync-wiki.shSemver. Pre-1.0: 0.x.y — a breaking change bumps x, features/fixes bump
y. The FFI is explicitly unstable until 1.0 (#[doc(cfg)]/docs call
this out).