forked from axodotdev/cargo-dist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support publishing prereleases even if there are only custom publish …
…jobs Fixes axodotdev#1744
- Loading branch information
1 parent
b96f4b7
commit 7c8007a
Showing
5 changed files
with
107 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//! custom publisher config | ||
use super::*; | ||
|
||
/// Options for custom publishes | ||
#[derive(Debug, Default, Clone, Serialize, Deserialize)] | ||
pub struct CustomPublisherLayer { | ||
/// Common options | ||
pub common: CommonPublisherLayer, | ||
} | ||
/// Options for custom publishes | ||
#[derive(Debug, Default, Clone, PartialEq, Eq)] | ||
pub struct CustomPublisherConfig { | ||
/// Common options | ||
pub common: CommonPublisherConfig, | ||
} | ||
|
||
impl CustomPublisherConfig { | ||
/// Get defaults for the given package | ||
pub fn defaults_for_package( | ||
_workspaces: &WorkspaceGraph, | ||
_pkg_idx: PackageIdx, | ||
common: &CommonPublisherConfig, | ||
) -> Self { | ||
Self { | ||
common: common.clone(), | ||
} | ||
} | ||
} | ||
|
||
impl ApplyLayer for CustomPublisherConfig { | ||
type Layer = CustomPublisherLayer; | ||
fn apply_layer(&mut self, Self::Layer { common }: Self::Layer) { | ||
self.common.apply_layer(common); | ||
} | ||
} | ||
impl ApplyLayer for CustomPublisherLayer { | ||
type Layer = CustomPublisherLayer; | ||
fn apply_layer(&mut self, Self::Layer { common }: Self::Layer) { | ||
self.common.apply_layer(common); | ||
} | ||
} | ||
|
||
impl std::ops::Deref for CustomPublisherConfig { | ||
type Target = CommonPublisherConfig; | ||
fn deref(&self) -> &Self::Target { | ||
&self.common | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters