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
15 changes: 13 additions & 2 deletions src/builds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ async fn get_temp_credentials(
engine: &str,
engine_version: &str,
entrypoint: Option<&str>,
message: Option<&str>,
version: &str,
api_key: &str,
) -> Result<TempCredsResponse> {
let client = config::create_http_client()?;
Expand All @@ -72,6 +74,13 @@ async fn get_temp_credentials(
request_body["entrypoint"] = serde_json::json!(ep);
}

// Add build message if provided
if let Some(msg) = message {
request_body["buildMessage"] = serde_json::json!(msg);
}

request_body["version"] = serde_json::json!(version);

let response = client
.post(&url)
.header("Authorization", format!("Bearer {}", api_key))
Expand Down Expand Up @@ -138,7 +147,7 @@ async fn notify_upload_complete(
Ok(())
}

pub async fn handle_build_push(config_path: PathBuf, verbose: bool) -> Result<()> {
pub async fn handle_build_push(config_path: PathBuf, verbose: bool, message: Option<String>) -> Result<()> {
// Load wavedash.toml config
let wavedash_config = WavedashConfig::load(&config_path)?;

Expand Down Expand Up @@ -168,8 +177,10 @@ pub async fn handle_build_push(config_path: PathBuf, verbose: bool) -> Result<()
&wavedash_config.game_id,
&wavedash_config.branch,
engine_kind.as_config_key(),
wavedash_config.version()?,
wavedash_config.engine_version()?,
wavedash_config.entrypoint(),
message.as_deref(),
&wavedash_config.version,
&api_key,
)
.await?;
Expand Down
3 changes: 2 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ pub struct WavedashConfig {
pub game_id: String,
pub branch: String,
pub upload_dir: PathBuf,
pub version: String,

#[serde(rename = "godot")]
pub godot: Option<GodotSection>,
Expand Down Expand Up @@ -174,7 +175,7 @@ impl WavedashConfig {
}
}

pub fn version(&self) -> Result<&str> {
pub fn engine_version(&self) -> Result<&str> {
if let Some(ref godot) = self.godot {
Ok(&godot.version)
} else if let Some(ref unity) = self.unity {
Expand Down
2 changes: 1 addition & 1 deletion src/dev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub async fn handle_dev(config_path: Option<PathBuf>, verbose: bool, no_open: bo
let sandbox_url = build_sandbox_url(
&wavedash_config,
engine_label,
wavedash_config.version()?,
wavedash_config.engine_version()?,
&local_origin,
entrypoint.as_deref(),
entrypoint_params.as_ref(),
Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ enum BuildCommands {
default_value = "./wavedash.toml"
)]
config: PathBuf,
#[arg(short = 'm', long = "message", help = "Build message")]
message: Option<String>,
},
}

Expand Down Expand Up @@ -144,8 +146,8 @@ async fn main() -> Result<()> {
}
}
Commands::Build { action } => match action {
BuildCommands::Push { config } => {
handle_build_push(config, cli.verbose).await?;
BuildCommands::Push { config, message } => {
handle_build_push(config, cli.verbose, message).await?;
}
},
Commands::Dev { config, no_open } => {
Expand Down