fn publish_and_release(path: &str, manifest: &CargoToml, new_version: Version) {
    let current = std::env::current_dir().unwrap();
    log::info!("cd {}", path);
    std::env::set_current_dir(path).unwrap();
    log::info!("cargo test");
    cmd_lib::spawn!(cargo test).unwrap().wait().unwrap();
    log::info!("cargo check");
    cmd_lib::spawn!(cargo check).unwrap().wait().unwrap();
    log::info!("cargo clippy");
    cmd_lib::spawn!(cargo clippy).unwrap().wait().unwrap();
    log::info!("cargo build");
    cmd_lib::spawn!(cargo build).unwrap().wait().unwrap();
    log::info!("cargo publish --dry-run --allow-dirty");
    cmd_lib::spawn!(cargo publish --dry-run --allow-dirty)
        .unwrap()
        .wait()
        .unwrap();
    std::env::set_current_dir(&current).unwrap();

    let commit_message = format!("{}@{}", manifest.package.name, new_version.to_string());
    cmd_lib::spawn!(git add .).unwrap().wait().unwrap();
    cmd_lib::spawn!(git commit -m "$commit_message")
        .unwrap()
        .wait()
        .unwrap();
    cmd_lib::spawn!(git tag $commit_message)
        .unwrap()
        .wait()
        .unwrap();

    std::env::set_current_dir(path).unwrap();
    log::info!("cargo publish");
    cmd_lib::spawn!(cargo publish).unwrap().wait().unwrap();
    std::env::set_current_dir(&current).unwrap();
}
/// Run unit-tests and publish crate
Run unit-tests and publish crate
Run unit - tests and publish crate
fn publish_and_release(path: &str, manifest: &CargoToml, new_version: Version) {
    let current = std::env::current_dir().unwrap();
    log::info!("cd {}", path);
    std::env::set_current_dir(path).unwrap();
    log::info!("cargo test");
    cmd_lib::spawn!(cargo test).unwrap().wait().unwrap();
    log::info!("cargo check");
    cmd_lib::spawn!(cargo check).unwrap().wait().unwrap();
    log::info!("cargo clippy");
    cmd_lib::spawn!(cargo clippy).unwrap().wait().unwrap();
    log::info!("cargo build");
    cmd_lib::spawn!(cargo build).unwrap().wait().unwrap();
    log::info!("cargo publish --dry-run --allow-dirty");
    cmd_lib::spawn!(cargo publish --dry-run --allow-dirty)
        .unwrap()
        .wait()
        .unwrap();
    std::env::set_current_dir(&current).unwrap();
    let commit_message = format!("{}@{}", manifest.package.name, new_version.to_string());
    cmd_lib::spawn!(git add .).unwrap().wait().unwrap();
    cmd_lib::spawn!(git commit -m "$commit_message")
        .unwrap()
        .wait()
        .unwrap();
    cmd_lib::spawn!(git tag $commit_message)
        .unwrap()
        .wait()
        .unwrap();
    std::env::set_current_dir(path).unwrap();
    log::info!("cargo publish");
    cmd_lib::spawn!(cargo publish).unwrap().wait().unwrap();
    std::env::set_current_dir(&current).unwrap();
}
fn publish_and_release ( path : & str , manifest : & CargoToml , new_version : Version ) { let current = std :: env :: current_dir ( ) . unwrap ( ) ; log :: info ! ( " " path ) ; std :: env :: set_current_dir ( path ) . unwrap ( ) ; log :: info ! ( " " ) ; cmd_lib :: spawn ! ( cargo test ) . unwrap ( ) . wait ( ) . unwrap ( ) ; log :: info ! ( " " ) ; cmd_lib :: spawn ! ( cargo check ) . unwrap ( ) . wait ( ) . unwrap ( ) ; log :: info ! ( " " ) ; cmd_lib :: spawn ! ( cargo clippy ) . unwrap ( ) . wait ( ) . unwrap ( ) ; log :: info ! ( " " ) ; cmd_lib :: spawn ! ( cargo build ) . unwrap ( ) . wait ( ) . unwrap ( ) ; log :: info ! ( " " ) ; cmd_lib :: spawn ! ( cargo publish dry run allow dirty ) . unwrap ( ) . wait ( ) . unwrap ( ) ; std :: env :: set_current_dir ( & current ) . unwrap ( ) ; let commit_message = format ! ( " " manifest package name new_version to_string ( ) ) ; cmd_lib :: spawn ! ( git add ) . unwrap ( ) . wait ( ) . unwrap ( ) ; cmd_lib :: spawn ! ( git commit m " " ) . unwrap ( ) . wait ( ) . unwrap ( ) ; cmd_lib :: spawn ! ( git tag $ commit_message ) . unwrap ( ) . wait ( ) . unwrap ( ) ; std :: env :: set_current_dir ( path ) . unwrap ( ) ; log :: info ! ( " " ) ; cmd_lib :: spawn ! ( cargo publish ) . unwrap ( ) . wait ( ) . unwrap ( ) ; std :: env :: set_current_dir ( & current ) . unwrap ( ) ; }
Run unit-tests and publish crate
Run unit - tests and publish crate
path
&str
manifest
&CargoToml
new_version
Version
path
&str
manifest
&CargoToml
new_version
Version