| 388 | } |
| 389 | |
| 390 | fn verify_crates_io(krate: &Crate) { |
| 391 | let name = &krate.name; |
| 392 | let Some(owners) = curl(&format!("https://crates.io/api/v1/crates/{name}/owners")) else { |
| 393 | panic!( |
| 394 | " |
| 395 | failed to get owners for {name} |
| 396 | |
| 397 | If this crate does not exist on crates.io yet please ping wstd maintainers |
| 398 | to add the crate on crates.io as a small shim. When doing so please remind them |
| 399 | that the trusted publishing workflow must be configured as well. |
| 400 | ", |
| 401 | name = name, |
| 402 | ); |
| 403 | }; |
| 404 | |
| 405 | // This is the id of the `wasmtime-publish` user on crates.io |
| 406 | if !owners.contains("\"id\":73222,") { |
| 407 | panic!( |
| 408 | " |
| 409 | crate {name} is not owned by wasmtime-publish, please run: |
| 410 | |
| 411 | cargo owner -a wasmtime-publish {name} |
| 412 | ", |
| 413 | name = name, |
| 414 | ); |
| 415 | } |
| 416 | |
| 417 | if owners.split("\"id\"").count() != 2 { |
| 418 | panic!( |
| 419 | " |
| 420 | crate {name} is not exclusively owned by wasmtime-publish |
| 421 | |
| 422 | Please contact wstd maintainers to ensure that `wasmtime-publish` is the |
| 423 | only listed owner of the crate. |
| 424 | ", |
| 425 | name = name, |
| 426 | ); |
| 427 | } |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | fn curl(url: &str) -> Option<String> { |