diff --git a/src/api/repos/releases.rs b/src/api/repos/releases.rs index 68ee4792..f75daa8b 100644 --- a/src/api/repos/releases.rs +++ b/src/api/repos/releases.rs @@ -403,6 +403,8 @@ pub struct UpdateReleaseBuilder<'octo, 'repos, 'handler, 'tag_name, 'target_comm draft: Option, #[serde(skip_serializing_if = "Option::is_none")] prerelease: Option, + #[serde(skip_serializing_if = "Option::is_none")] + make_latest: Option, } impl<'octo, 'repos, 'handler, 'tag_name, 'target_commitish, 'name, 'body> @@ -418,6 +420,7 @@ impl<'octo, 'repos, 'handler, 'tag_name, 'target_commitish, 'name, 'body> body: None, draft: None, prerelease: None, + make_latest: None, } } @@ -463,6 +466,14 @@ impl<'octo, 'repos, 'handler, 'tag_name, 'target_commitish, 'name, 'body> self } + /// Specifies whether this release should be set as the latest release for the repository. + /// Drafts and prereleases cannot be set as latest. + /// [`MakeLatest::Legacy`] specifies that the latest release should be determined based on the release creation date and higher semantic version. + pub fn make_latest(mut self, make_latest: MakeLatest) -> Self { + self.make_latest = Some(make_latest); + self + } + /// Sends the actual request. pub async fn send(self) -> crate::Result { let route = format!(