(krate: &Crate)
| 578 | } |
| 579 | |
| 580 | fn verify_crates_io(krate: &Crate) { |
| 581 | let name = &krate.name; |
| 582 | let Some(owners) = curl(&format!("https://crates.io/api/v1/crates/{name}/owners")) else { |
| 583 | panic!( |
| 584 | " |
| 585 | failed to get owners for {name} |
| 586 | |
| 587 | If this crate does not exist on crates.io yet please visit |
| 588 | |
| 589 | https://docs.wasmtime.dev/contributing-coding-guidelines.html#adding-crates |
| 590 | |
| 591 | and follow the instructions there |
| 592 | ", |
| 593 | name = name, |
| 594 | ); |
| 595 | }; |
| 596 | |
| 597 | // This is the id of the `wasmtime-publish` user on crates.io |
| 598 | if !owners.contains("\"id\":73222,") { |
| 599 | panic!( |
| 600 | " |
| 601 | crate {name} is not owned by wasmtime-publish, please visit: |
| 602 | |
| 603 | https://docs.wasmtime.dev/contributing-coding-guidelines.html#adding-crates |
| 604 | |
| 605 | and follow the instructions there |
| 606 | ", |
| 607 | name = name, |
| 608 | ); |
| 609 | } |
| 610 | |
| 611 | // TODO: waiting for trusted publishing to be proven to work before |
| 612 | // activating this. |
| 613 | if false && owners.split("\"id\"").count() != 2 { |
| 614 | panic!( |
| 615 | " |
| 616 | crate {name} is not exclusively owned by wasmtime-publish, please visit: |
| 617 | |
| 618 | https://docs.wasmtime.dev/contributing-coding-guidelines.html#adding-crates |
| 619 | |
| 620 | and follow the instructions there |
| 621 | ", |
| 622 | name = name, |
| 623 | ); |
| 624 | } |
| 625 | } |
| 626 | } |
no test coverage detected