Skip to content

Commit

Permalink
refactor: use cargo-package instead of cargo-publish
Browse files Browse the repository at this point in the history
There is a dedicated cargo command to create local packages.
  • Loading branch information
link2xt authored and paolobarbolini committed Apr 2, 2024
1 parent 1488ddb commit 3db7c05
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ fn main() -> Result<()> {
}

//
// Soft publish the package
// Create local package
//

let package_path = repo_dir
Expand All @@ -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;
Expand Down

0 comments on commit 3db7c05

Please sign in to comment.