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_number",
9
        "merc_io",
10
        "merc_collections",
11
        "merc_unsafety",
12
        "merc_sharedmutex",
13
        "merc_macros",
14
        "merc_aterm",
15
        "merc_data",
16
        "merc_lts",
17
        "merc_reduction",
18
        "merc_refinement",
19
        "merc_syntax",
20
        "merc_sabre",
21
        "merc_ldd",
22
        "merc_symbolic",
23
        "merc_vpg",
24
    ];
25

            
26
    for library in &crates {
27
        // First do a dry run of the publish command to check that everything is fine.
28
        cmd!("cargo", "publish", "--dry-run", "-p", library)
29
            .run()
30
            .unwrap_or_else(|err| panic!("Failed to publish crate {}: {}", library, err));
31
    }
32
}