diff --git a/Cargo.toml b/Cargo.toml index 6ac29c6..4097646 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "xtask" -version = "0.1.3" +name = "xtask-kit" +version = "0.1.4" edition = "2024" rust-version = "1.85" authors = ["ArcBox Labs "] @@ -9,7 +9,7 @@ description = "Reusable building blocks for Rust xtask automation." readme = "README.md" repository = "https://github.com/arcboxlabs/xtask" homepage = "https://github.com/arcboxlabs/xtask" -documentation = "https://docs.rs/xtask" +documentation = "https://docs.rs/xtask-kit" keywords = ["xtask", "automation", "release", "macos", "codesign"] categories = ["development-tools::build-utils", "command-line-utilities"] exclude = [".github/"] diff --git a/README.md b/README.md index a910578..7c31a6c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# xtask +# xtask-kit Reusable building blocks for Rust `xtask` crates. This crate is deliberately **not** a framework for defining one universal `xtask` CLI. Each repository should keep its own `clap` command tree and product-specific -build flow. `xtask` provides the small, reusable primitives that tend to be copied +build flow. `xtask-kit` provides the small, reusable primitives that tend to be copied between repositories: repository paths, file checks, process helpers, artifact hashing, Apple signing, DMG packaging, Sparkle appcasts, and GitHub Actions outputs. @@ -30,14 +30,14 @@ downstream repository. Pass the manifest directory from your repository's `xtask crate instead: ```rust -let root = xtask::repo::root_from_xtask_manifest(env!("CARGO_MANIFEST_DIR"))?; +let root = xtask_kit::repo::root_from_xtask_manifest(env!("CARGO_MANIFEST_DIR"))?; # anyhow::Ok(()) ``` ## Basic usage ```rust,no_run -use xtask::{fs, hash, repo}; +use xtask_kit::{fs, hash, repo}; let root = repo::root_from_xtask_manifest(env!("CARGO_MANIFEST_DIR"))?; let app = root.join("target/release/MyApp.app"); @@ -53,9 +53,9 @@ println!("sha256={sha}"); ```rust,no_run #[cfg(target_os = "macos")] fn sign_app(app: &std::path::Path) -> anyhow::Result<()> { - let options = xtask::apple::CodesignOptions::runtime("Developer ID Application", app); - xtask::apple::codesign(&options)?; - xtask::apple::verify_signature(app) + let options = xtask_kit::apple::CodesignOptions::runtime("Developer ID Application", app); + xtask_kit::apple::codesign(&options)?; + xtask_kit::apple::verify_signature(app) } # #[cfg(target_os = "macos")] # sign_app(std::path::Path::new("MyApp.app"))?; @@ -67,8 +67,8 @@ fn sign_app(app: &std::path::Path) -> anyhow::Result<()> { ```rust,no_run #[cfg(target_os = "macos")] fn package(app: std::path::PathBuf, output: std::path::PathBuf) -> anyhow::Result<()> { - let options = xtask::dmg::CreateDmgOptions::new("MyApp", app, output); - xtask::dmg::create(&options) + let options = xtask_kit::dmg::CreateDmgOptions::new("MyApp", app, output); + xtask_kit::dmg::create(&options) } # #[cfg(target_os = "macos")] # package("MyApp.app".into(), "MyApp.dmg".into())?; @@ -77,10 +77,20 @@ fn package(app: std::path::PathBuf, output: std::path::PathBuf) -> anyhow::Resul ## Publishing -The package name `xtask` is intentionally short. Before publishing, run: +Publish both package names for each release: + +- `xtask` keeps existing users compatible. +- `xtask-kit` is the preferred non-colliding package name for repositories that + already have their own `xtask` package. + +For each package name, run: ```sh cargo publish --dry-run --all-features +cargo publish --all-features ``` -Then publish with a crates.io token from an account that should own the crate. +Keep the version number identical for both packages. The repository normally +tracks the `xtask-kit` package metadata; publish the compatibility `xtask` +package from a temporary clean checkout or release branch by changing only +`package.name` and docs.rs metadata for that publish. diff --git a/src/process.rs b/src/process.rs index a3e941b..f06431b 100644 --- a/src/process.rs +++ b/src/process.rs @@ -13,7 +13,7 @@ use xshell::Shell; /// ``` /// # fn run() -> anyhow::Result<()> { /// if true { -/// return Err(xtask::process::ExitCode::new(2).into()); +/// return Err(xtask_kit::process::ExitCode::new(2).into()); /// } /// # Ok(()) /// # } diff --git a/src/repo.rs b/src/repo.rs index a6805a7..d902b87 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -7,7 +7,7 @@ use anyhow::{Context, Result}; /// Pass `env!("CARGO_MANIFEST_DIR")` from the *calling* `xtask` crate: /// /// ```no_run -/// let root = xtask::repo::root_from_xtask_manifest(env!("CARGO_MANIFEST_DIR"))?; +/// let root = xtask_kit::repo::root_from_xtask_manifest(env!("CARGO_MANIFEST_DIR"))?; /// # anyhow::Ok(()) /// ``` ///