Skip to content
Merged
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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Features

- Allow specifying a `--target` triple when running `cargo smart-release`, forwarding it to `cargo publish` so crates that don't
compile for the host can still be released ([#89](https://github.com/GitoxideLabs/cargo-smart-release/issues/89)).

## 0.21.8 (2025-08-03)

### Bug Fixes
Expand Down Expand Up @@ -2776,4 +2783,3 @@ For more information, run `cargo changelog -h`.
## v0.1.0 (2021-08-13)

- initial release

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ When developing various crates in a workspace, when committing changes and if th
change I want to see in changelogs, [conventional] git messages will be used. This helps building changelog scaffolding automatically later.

When ready for releasing a particular crate or set of crates of interest, run `cargo smart-release [<crate-name> ...]` to simulate a release. For particularly thorough
but error-prone simulations (as in false positives) one could run `cargo smart-release --dry-run-cargo-publish`. To polish changelogs, run `cargo changelog --write <crate-name>`
but error-prone simulations (as in false positives) one could run `cargo smart-release --dry-run-cargo-publish`. Crates that don't compile for the host can be released by
passing `--target <triple>`, which is forwarded to every `cargo publish` invocation (including dry runs). To polish changelogs, run `cargo changelog --write <crate-name>`
to update the scaffolding and edit it by hand until it fits.

After evaluating the release procedure and following instructions,
Expand Down
2 changes: 2 additions & 0 deletions src/cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ fn main() -> anyhow::Result<()> {
no_isolate_dependencies_from_breaking_changes,
capitalize_commit,
registry,
target,
signoff,
commit_prefix,
} => {
Expand Down Expand Up @@ -95,6 +96,7 @@ fn main() -> anyhow::Result<()> {
allow_changelog_github_release: !no_changelog_github_release,
capitalize_commit,
registry,
target,
signoff,
commit_prefix,
},
Expand Down
6 changes: 6 additions & 0 deletions src/cli/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ pub enum SubCommands {
#[clap(long, help_heading = Some("CUSTOMIZATION"))]
registry: Option<String>,

/// Build and package the crate for the given target triple when invoking `cargo publish`.
///
/// This flag is forwarded to all `cargo publish` invocations, including dry runs.
#[clap(long, help_heading = Some("CUSTOMIZATION"))]
target: Option<String>,

/// Pass --no-verify to 'cargo publish' which should only be a last resort when fixing up packages that
/// otherwise wouldn't publish, but need to be publish to resolve the situation.
#[clap(long, help_heading = Some("EXPERT"))]
Expand Down
1 change: 1 addition & 0 deletions src/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub mod release {
pub allow_changelog_github_release: bool,
pub capitalize_commit: bool,
pub registry: Option<String>,
pub target: Option<String>,
pub signoff: bool,
pub commit_prefix: Option<String>,
}
Expand Down
4 changes: 4 additions & 0 deletions src/command/release/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub(in crate::command::release_impl) fn publish_crate(
no_verify,
verbose,
registry,
target,
..
}: Options,
) -> anyhow::Result<()> {
Expand All @@ -33,6 +34,9 @@ pub(in crate::command::release_impl) fn publish_crate(
if let Some(ref registry) = registry {
c.arg("--registry").arg(registry);
}
if let Some(ref target) = target {
c.arg("--target").arg(target);
}

if allow_dirty {
c.arg("--allow-dirty");
Expand Down
Loading