Implement trusted publishing (#7548)

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
This commit is contained in:
konsti 2024-09-24 18:07:20 +02:00 committed by GitHub
parent c053dc84f4
commit 205bf8cabe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 502 additions and 40 deletions

View file

@ -16,6 +16,7 @@ pub use preview::*;
pub use sources::*;
pub use target_triple::*;
pub use trusted_host::*;
pub use trusted_publishing::*;
mod authentication;
mod build_options;
@ -35,3 +36,4 @@ mod preview;
mod sources;
mod target_triple;
mod trusted_host;
mod trusted_publishing;

View file

@ -0,0 +1,15 @@
use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Default, Deserialize, PartialEq, Eq, Serialize)]
#[serde(rename_all = "kebab-case")]
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
pub enum TrustedPublishing {
/// Try trusted publishing when we're already in GitHub Actions, continue if that fails.
#[default]
Automatic,
// Force trusted publishing.
Always,
// Never try to get a trusted publishing token.
Never,
}