From 3db7c05aa35749cc4e0f0f892bc5831219901f98 Mon Sep 17 00:00:00 2001 From: link2xt Date: Tue, 2 Apr 2024 04:10:37 +0000 Subject: [PATCH] refactor: use cargo-package instead of cargo-publish There is a dedicated cargo command to create local packages. --- src/main.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2ce20a4..04ed60f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -430,7 +430,7 @@ fn main() -> Result<()> { } // - // Soft publish the package + // Create local package // let package_path = repo_dir @@ -439,24 +439,20 @@ fn main() -> Result<()> { .join(format!("{}-{}.crate", package.name, package.version)); if !package_path.try_exists()? { - println!( - "Soft publishing release {} v{}", - package.name, package.version - ); + println!("Packaging release {} v{}", package.name, package.version); let out = Command::new("cargo") - .arg("publish") - .arg("--dry-run") + .arg("package") .arg("--no-verify") .arg("--package") .arg(package.name.as_str()) .current_dir(&repo_dir) .env("RUSTUP_TOOLCHAIN", &default_toolchain) .output() - .context("publish the package")?; + .context("cargo package")?; if !out.status.success() { println!( - "Couldn't publish the package in {} repo status={}", + "Couldn't assemble the package in {} repo status={}", repository, out.status ); continue;