Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
78307ec8a3
commit
67c2c0c0c5
@ -2,20 +2,15 @@ use std::path::Path;
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
|
||||||
use clap::Args;
|
use clap::Args;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use clap::Subcommand;
|
use clap::Subcommand;
|
||||||
use clap::ValueEnum;
|
use clap::ValueEnum;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use dagger_sdk::Platform;
|
use dagger_sdk::Platform;
|
||||||
use dagger_sdk::QueryContainerOpts;
|
use dagger_sdk::QueryContainerOpts;
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use crate::please_release::run_release_please;
|
use crate::please_release::run_release_please;
|
||||||
|
|
||||||
#[derive(Parser, Clone)]
|
#[derive(Parser, Clone)]
|
||||||
@ -257,8 +252,6 @@ mod please_release {
|
|||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use crate::{base_rust_image, GlobalArgs};
|
use crate::{base_rust_image, GlobalArgs};
|
||||||
|
|
||||||
pub async fn run_release_please(
|
pub async fn run_release_please(
|
||||||
@ -429,10 +422,6 @@ mod build {
|
|||||||
|
|
||||||
use dagger_sdk::Container;
|
use dagger_sdk::Container;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use crate::{base_rust_image, get_base_debian_image, GlobalArgs};
|
use crate::{base_rust_image, get_base_debian_image, GlobalArgs};
|
||||||
|
|
||||||
pub async fn build_and_deploy(
|
pub async fn build_and_deploy(
|
||||||
|
@ -50,10 +50,8 @@ impl ReleaseCommandHandler {
|
|||||||
tracing::trace!("fetched commits since last version");
|
tracing::trace!("fetched commits since last version");
|
||||||
let current_version = get_current_version(significant_tag);
|
let current_version = get_current_version(significant_tag);
|
||||||
tracing::trace!("found current version: {}", current_version.to_string());
|
tracing::trace!("found current version: {}", current_version.to_string());
|
||||||
self.ui.write_str_ln(&format!(
|
self.ui
|
||||||
"found current version: {}",
|
.write_str_ln(&format!("found current version: {}", current_version));
|
||||||
current_version
|
|
||||||
));
|
|
||||||
|
|
||||||
let conventional_commit_results = parse_conventional_commits(current_version, commits)?;
|
let conventional_commit_results = parse_conventional_commits(current_version, commits)?;
|
||||||
tracing::trace!("parsing conventional commits");
|
tracing::trace!("parsing conventional commits");
|
||||||
@ -64,10 +62,8 @@ impl ReleaseCommandHandler {
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
let (commit_strs, next_version) = conventional_commit_results.unwrap();
|
let (commit_strs, next_version) = conventional_commit_results.unwrap();
|
||||||
self.ui.write_str_ln(&format!(
|
self.ui
|
||||||
"calculated next version: {}",
|
.write_str_ln(&format!("calculated next version: {}", next_version));
|
||||||
next_version
|
|
||||||
));
|
|
||||||
|
|
||||||
tracing::trace!("creating changelog");
|
tracing::trace!("creating changelog");
|
||||||
let (changelog_placement, changelog, changelog_last_changes) =
|
let (changelog_placement, changelog, changelog_last_changes) =
|
||||||
@ -253,7 +249,6 @@ fn parse_conventional_commits(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_current_version(significant_tag: Option<Tag>) -> Version {
|
fn get_current_version(significant_tag: Option<Tag>) -> Version {
|
||||||
|
|
||||||
significant_tag
|
significant_tag
|
||||||
.map(|st| Version::try_from(st).unwrap())
|
.map(|st| Version::try_from(st).unwrap())
|
||||||
.unwrap_or(Version::new(0, 0, 0))
|
.unwrap_or(Version::new(0, 0, 0))
|
||||||
|
@ -30,10 +30,9 @@ const CUDDLE_CONFIG_FILE_NAME: &str = "cuddle.please";
|
|||||||
const YAML_EXTENSION: &str = "yaml";
|
const YAML_EXTENSION: &str = "yaml";
|
||||||
|
|
||||||
pub fn get_config_from_config_file(current_dir: &Path) -> PleaseConfigBuilder {
|
pub fn get_config_from_config_file(current_dir: &Path) -> PleaseConfigBuilder {
|
||||||
let current_cuddle_path = current_dir
|
let current_cuddle_path = current_dir.join(format!("{CUDDLE_FILE_NAME}.{YAML_EXTENSION}"));
|
||||||
.join(format!("{CUDDLE_FILE_NAME}.{YAML_EXTENSION}"));
|
let current_cuddle_config_path =
|
||||||
let current_cuddle_config_path = current_dir
|
current_dir.join(format!("{CUDDLE_CONFIG_FILE_NAME}.{YAML_EXTENSION}"));
|
||||||
.join(format!("{CUDDLE_CONFIG_FILE_NAME}.{YAML_EXTENSION}"));
|
|
||||||
let mut please_config = PleaseConfigBuilder::default();
|
let mut please_config = PleaseConfigBuilder::default();
|
||||||
|
|
||||||
if let Some(config) = get_config_from_file::<CuddleEmbeddedPleaseConfig>(current_cuddle_path) {
|
if let Some(config) = get_config_from_file::<CuddleEmbeddedPleaseConfig>(current_cuddle_path) {
|
||||||
|
Loading…
Reference in New Issue
Block a user