Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <team@arcbox.dev>"]
Expand All @@ -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/"]
Expand Down
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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");
Expand All @@ -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"))?;
Expand All @@ -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())?;
Expand All @@ -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.
2 changes: 1 addition & 1 deletion src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
/// # }
Expand Down
2 changes: 1 addition & 1 deletion src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
/// ```
///
Expand Down