2024-01-27 23:26:49 +01:00
|
|
|
use autocrate::{
|
|
|
|
changelog::*,
|
|
|
|
config::{
|
|
|
|
cli::{Cli, Commands},
|
|
|
|
Config,
|
|
|
|
},
|
|
|
|
error::*,
|
2024-02-16 19:01:54 +01:00
|
|
|
publish::publish,
|
|
|
|
release::release,
|
2024-02-16 20:03:20 +01:00
|
|
|
serverapi::init_servers,
|
2024-01-27 23:26:49 +01:00
|
|
|
};
|
2024-01-24 23:04:01 +01:00
|
|
|
|
2024-02-16 18:37:19 +01:00
|
|
|
#[tokio::main]
|
|
|
|
async fn main() -> Result<()> {
|
2024-01-24 23:04:01 +01:00
|
|
|
let cli = Cli::cli_parse();
|
2024-02-16 18:58:20 +01:00
|
|
|
let cfg = Config::load(&cli)?;
|
2024-01-24 23:04:01 +01:00
|
|
|
|
2024-01-27 23:26:49 +01:00
|
|
|
match cli.command {
|
|
|
|
Commands::Changelog { .. } => {
|
2024-02-16 16:43:33 +01:00
|
|
|
println!("{}", Changelog::build(&cfg)?);
|
2024-01-27 23:26:49 +01:00
|
|
|
}
|
2024-01-27 23:46:00 +01:00
|
|
|
Commands::Release { .. } => {
|
2024-02-16 20:03:20 +01:00
|
|
|
let mut apis = init_servers(&cfg).await?;
|
|
|
|
release(&cfg, &mut apis).await?;
|
2024-01-27 23:46:00 +01:00
|
|
|
}
|
|
|
|
Commands::Publish { .. } => {
|
2024-02-16 20:00:55 +01:00
|
|
|
publish(&cfg).await?;
|
2024-01-27 23:46:00 +01:00
|
|
|
}
|
2024-02-19 22:07:51 +01:00
|
|
|
Commands::Version {} => {
|
|
|
|
// TODO: version bump
|
|
|
|
// TODO: version select interactive
|
|
|
|
// TODO: version select automated
|
|
|
|
todo!()
|
|
|
|
}
|
2024-02-24 13:24:14 +01:00
|
|
|
Commands::Init { .. } => {
|
|
|
|
// TODO: create a basic autocrate yaml
|
|
|
|
todo!()
|
|
|
|
}
|
2024-02-16 18:37:19 +01:00
|
|
|
};
|
|
|
|
Ok(())
|
2024-01-23 21:38:11 +01:00
|
|
|
}
|