diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dd6aa0..b83260b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,12 +112,11 @@ jobs: - name: Unused dependencies run: cargo machete - # Reports public API changes that need a version bump, compared with main. - # Informational until the first crates.io release; then remove continue-on-error. + # Fails when a PR breaks the public API without bumping the version (0.2 -> 0.3). + # Additions pass. semver: if: github.event_name == 'pull_request' runs-on: ubuntu-latest - continue-on-error: true steps: - uses: actions/checkout@v4 with: diff --git a/CLAUDE.md b/CLAUDE.md index 9138ae3..815e3f7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -50,4 +50,7 @@ Keep the public surface small: modules private by default, export through `lib.r - Duplicate edges and duplicate pre-trust peers: the last one wins. - Weights must be finite and non-negative; distrust (negative weights) is rejected. - The iteration stops after `max_iterations` (default 10,000) with `EigenTrustError::NotConverged`. -- Version 0.2.0 is not on crates.io yet; the CI semver job is informational until it is. +- Published on crates.io as `eigentrust` and `eigentrust-cli`. The CI semver job fails on PRs + that break the public API without a version bump. Bump all three crates' versions (and the + `eigentrust = "x.y"` requirements in cli/ and wasm/) together. +- Release: `cargo publish -p eigentrust`, then `cargo publish -p eigentrust-cli`. diff --git a/README.md b/README.md index b70f553..7c0c8bb 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@
+
+
@@ -25,11 +27,20 @@ It is the algorithm from the [EigenTrust paper](https://nlp.stanford.edu/pubs/ei
**Try it: [eigentrust.jenyadoesapps.com](https://eigentrust.jenyadoesapps.com)**, a live playground in 10 languages that can also rank 250,000 peers in the browser.
+Published on crates.io:
+
+| Crate | What you get | Links |
+| --- | --- | --- |
+| [`eigentrust`](https://crates.io/crates/eigentrust) | the Rust library | [docs.rs](https://docs.rs/eigentrust) |
+| [`eigentrust-cli`](https://crates.io/crates/eigentrust-cli) | the `eigentrust` command | [install](#command-line) |
+
## Rust library
+The [`eigentrust`](https://crates.io/crates/eigentrust) crate on crates.io:
+
```toml
[dependencies]
-eigentrust = { git = "https://github.com/hypnagonia/eigentrust-rust" }
+eigentrust = "0.2"
```
```rust
@@ -60,12 +71,14 @@ fn main() -> Result<(), eigentrust::EigenTrustError> {
- `parallel` runs the iteration on all cores with rayon.
- There are no required dependencies beyond `log`, and the same code builds for `wasm32`.
-The crate documentation (`cargo doc --open`) covers the exact input rules and convergence behavior. See also [`examples/`](examples).
+The [documentation on docs.rs](https://docs.rs/eigentrust) covers the exact input rules and convergence behavior. See also [`examples/`](examples).
## Command line
+The [`eigentrust-cli`](https://crates.io/crates/eigentrust-cli) crate on crates.io:
+
```sh
-cargo install --git https://github.com/hypnagonia/eigentrust-rust eigentrust-cli
+cargo install eigentrust-cli
eigentrust localtrust.csv pretrust.csv [alpha]
```