1
use duct::cmd;
2

            
3
/// Runs `cargo publish --dry-run` for all crates to verify they can be published.
4
pub fn publish_crates() {
5
    // The list of crates to publish, they must be published in order of dependencies, i.e., downstream first.
6
    let crates = [
7
        "merc_utilities",
8
        "merc_unsafety",
9
        "merc_number",
10
        "merc_io",
11
        "merc_sharedmutex",
12
        "merc_macros",
13
        "merc_data",
14
        "merc_sabre",
15
        "merc_lts",
16
        "merc_reduction",
17
        "merc_vpg",
18
    ];
19

            
20
    for library in &crates {
21
        // First do a dry run of the publish command to check that everything is fine.
22
        cmd!("cargo", "publish", "--dry-run", "-p", library)
23
            .run()
24
            .unwrap_or_else(|err| panic!("Failed to publish crate {}: {}", library, err));
25
    }
26
}