use std::env;
use clap::Parser;
use gitcc_core::{Config, StatusShow};
use crate::{info, warn};
#[derive(Debug, Parser)]
pub struct ReleaseArgs {}
pub fn run(_args: ReleaseArgs) -> anyhow::Result<()> {
let cwd = env::current_dir()?;
let config = Config::load_from_fs(&cwd)?;
let _config = if let Some(cfg) = config {
cfg
} else {
info!("using default config");
Config::default()
};
let dirty_files = gitcc_core::git_status(&cwd, StatusShow::IndexAndWorkdir)?;
if !dirty_files.is_empty() {
warn!("repo is dirty");
}
eprintln!("1: make sure there is no untracked/uncommitted changes");
eprintln!("2: create the changelog file");
eprintln!("3: commit the changelog");
eprintln!("4: tag the repo with the next version (annotated tag, leading 'v')");
eprintln!("5: push with --follow-tags");
eprintln!("6: create a Github release");
eprintln!("7: publish the release to creates.io");
Ok(())
}