From 54487622c09cd987e2c43373dc8f98bc70d4e13c Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Sun, 25 May 2025 09:08:22 -0500 Subject: [PATCH] Add CLI option for uploading files + dummy hookup I think this is the interface I want for uploading release files. There is an extra option to create the release ahead of the upload just in case it doesn't exist. One *should* create it with the create command or through the Gitea GUI so that everything can be properly written into the release info. --- src/cli.rs | 8 ++++++++ src/main.rs | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/cli.rs b/src/cli.rs index 5e88536..4674908 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -29,4 +29,12 @@ pub enum Commands { #[arg()] target_commitish: String, }, + UploadRelease { + #[arg()] + tag_name: String, + #[arg(short, long, default_value_t = false)] + create: bool, + #[arg()] + files: Vec + } } diff --git a/src/main.rs b/src/main.rs index c6347bb..a93e65d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,6 +40,19 @@ async fn main() -> Result<(), Error> { }; do_create_release(&client, &args.gitea_url, &args.repo, submission).await?; } + gt_tools::cli::Commands::UploadRelease { + tag_name, + create, + files + } => { + println!("Uploading files to a release!"); + println!("Release Tag: {tag_name}"); + println!("Creating?: {create}"); + println!("Files..."); + for file in files { + println!("--- {file}"); + } + } } Ok(())