To publish cdd-rust (and its sub-crates like cdd-core and cdd-cli) to crates.io, follow these steps:
-
Login to crates.io: Ensure you have an account on crates.io and have created an API token. Run
cargo loginand paste your token. -
Verify the Build: Ensure everything builds and tests pass.
cargo check cargo test -
Publish Sub-crates First: Publish the dependencies in the correct order (e.g.,
corebeforecli).cd core cargo publish cd ../cli cargo publish
When you publish a crate to crates.io, its documentation is automatically built and hosted on docs.rs. You do not need to do anything manually for this.
To build the documentation as static HTML files for hosting on your own server (like GitHub Pages, Netlify, or AWS S3):
- Build Docs Locally:
cargo doc --no-deps --document-private-items
- Locate the Output:
The static HTML files will be located in the
target/docdirectory. - Upload:
You can copy this folder to any static web host. For example, using
scp:scp -r target/doc/* user@your-server.com:/var/www/html/docs/