Configuration for a project with both Rust and TypeScript code, publishing to both crates.io and npm.
.
├── Cargo.toml # Rust library
├── src/ # Rust source
├── bindings/
│ └── node/ # Node.js bindings (napi-rs or similar)
│ └── package.json
- Releases Rust crate first, then npm package
- Useful for native Node.js modules
- Both packages share version
- Delay between publishes for registry indexing
- Copy both config files to your repo
- Add both secrets:
CARGO_REGISTRY_TOKENNPM_TOKEN
- Adjust paths to match your structure
- Rust crate published to crates.io
- Wait 30 seconds
- Node bindings published to npm
This ensures the Rust crate is available when npm package is installed (if it depends on it).