chore: improve crates.io metadata and add cargo publish to release#29
chore: improve crates.io metadata and add cargo publish to release#29mikkeldamsgaard merged 1 commit intomainfrom
Conversation
…rkflow
- Enrich description with subcommand keywords for search discoverability
- Add rust-version (MSRV 1.88), authors, and docs.rs documentation link
- Exclude tests/examples/CI/charts/docs from published crate to reduce size
- Add #![doc = include_str!("../README.md")] for docs.rs landing page
- Add cargo publish step to release workflow (requires CARGO_REGISTRY_TOKEN secret)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR enhances the crate's discoverability on crates.io and automates publishing to the Rust package registry. It enriches the Cargo.toml metadata with keyword-rich descriptions, sets the MSRV to 1.88, adds documentation links pointing to docs.rs, and excludes unnecessary directories from the published package. The PR also configures docs.rs to render the full README as the crate landing page and adds automated crates.io publishing to the release workflow.
Changes:
- Enhanced Cargo.toml metadata with keyword-rich description, MSRV, authors, docs.rs documentation URL, and exclude patterns to reduce package size
- Added doc attribute to include README.md in docs.rs rendering
- Automated crates.io publishing in the release workflow after tests pass
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Cargo.toml | Added rust-version MSRV, authors, enriched description with subcommand keywords, updated documentation URL to docs.rs, and added exclude patterns |
| src/main.rs | Added doc attribute to include README.md content in docs.rs crate documentation |
| .github/workflows/release.yml | Added cargo publish step after tests pass and before Docker builds |
| CHANGELOG.md | Documented metadata improvements and cargo publish automation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - run: cargo test --all | ||
| - name: Publish to crates.io |
There was a problem hiding this comment.
The cargo publish step lacks error handling for the case where the version has already been published to crates.io. If this workflow is re-run (e.g., due to a failure in a later step like Docker builds), cargo publish will fail because crate versions are immutable on crates.io. Consider adding || true or using cargo publish --dry-run first, or add a conditional check to skip publishing if the version already exists. Alternatively, add continue-on-error: true to allow the workflow to proceed even if publishing fails.
| - name: Publish to crates.io | |
| - name: Publish to crates.io | |
| continue-on-error: true |
Summary
Cargo.tomldescription with subcommand keywords (wait-for, migrate, seed, render, fetch) for better crates.io and AI search discoverabilityrust-version = "1.88"MSRV,authors, anddocumentationpointing to docs.rsexcludeto reduce published crate size (drops tests, examples, CI, charts, docs from the package)#![doc = include_str!("../README.md")]so docs.rs renders the full README as the crate landing pagecargo publishstep to the release workflow, running after tests pass and before Docker buildsSetup required
Add a
CARGO_REGISTRY_TOKENrepository secret (from https://crates.io/settings/tokens) for the publish step to work.Test plan
cargo clippy --all-targets --all-features -- -D warnings— cleancargo fmt -- --check— cleancargo test --all-features— 163 tests passcargo package --list --allow-dirty— 32 files, no excluded dirs leak through🤖 Generated with Claude Code