generated from PlexSheep/rs-base
Compare commits
No commits in common. "f12f5763d10938fedfcc4229f53b6238301abb0b" and "0abcdff5afbbebf474edb77529500c89864da1a5" have entirely different histories.
f12f5763d1
...
0abcdff5af
10 changed files with 13 additions and 99 deletions
|
@ -52,9 +52,6 @@ pub enum Commands {
|
|||
//
|
||||
// TODO:
|
||||
// find a way to make this a global option but only usable with specific subcommands
|
||||
//
|
||||
// TODO:
|
||||
// integrate a CHANGELOG.md file
|
||||
#[arg(short, long)]
|
||||
message: Option<Vec<String>>,
|
||||
},
|
||||
|
@ -63,7 +60,6 @@ pub enum Commands {
|
|||
#[arg(short, long)]
|
||||
message: Option<Vec<String>>,
|
||||
},
|
||||
Version {},
|
||||
}
|
||||
|
||||
impl Display for Commands {
|
||||
|
@ -75,7 +71,6 @@ impl Display for Commands {
|
|||
Self::Changelog { .. } => "Changelog",
|
||||
Self::Release { .. } => "Release",
|
||||
Self::Publish { .. } => "Publish",
|
||||
Self::Version { .. } => "Version",
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
@ -8,8 +8,6 @@ use url::Url;
|
|||
use crate::error::*;
|
||||
|
||||
pub mod cli;
|
||||
pub mod packages;
|
||||
use packages::*;
|
||||
use cli::Cli;
|
||||
|
||||
pub trait YamlConfigSection: Debug + Clone + for<'a> Deserialize<'a> {
|
||||
|
@ -103,8 +101,6 @@ pub enum ApiType {
|
|||
Gitlab,
|
||||
#[serde(alias = "github", alias = "GitHub")]
|
||||
Github,
|
||||
#[serde(alias = "forgejo")]
|
||||
Forgejo,
|
||||
}
|
||||
impl YamlConfigSection for ApiType {
|
||||
fn check(&self) -> Result<()> {
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
pub enum PackageType {
|
||||
Cargo
|
||||
}
|
|
@ -26,12 +26,6 @@ async fn main() -> Result<()> {
|
|||
Commands::Publish { .. } => {
|
||||
publish(&cfg).await?;
|
||||
}
|
||||
Commands::Version {} => {
|
||||
// TODO: version bump
|
||||
// TODO: version select interactive
|
||||
// TODO: version select automated
|
||||
todo!()
|
||||
}
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -2,26 +2,10 @@ use crate::{config::Config, error::*, serverapi::ApiCollection};
|
|||
|
||||
pub async fn release(_cfg: &Config, _apis: &mut ApiCollection) -> Result<()> {
|
||||
// TODO: git tag
|
||||
// TODO: version bump
|
||||
// TODO: version select interactive
|
||||
// TODO: version select automated
|
||||
// TODO: push to each server
|
||||
|
||||
// TODO: release to each server
|
||||
tag(cfg).await?;
|
||||
for api in apis.iter_mut() {
|
||||
api.push_release().await?;
|
||||
}
|
||||
|
||||
for api in apis.iter_mut() {
|
||||
api.push_release().await?;
|
||||
}
|
||||
|
||||
// TODO: check that the release is made
|
||||
// TODO: generate artifacts
|
||||
// TODO: upload artifacts
|
||||
// TODO: upload artifact signatures
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn tag(cfg: &Config) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
use async_trait::async_trait;
|
||||
|
||||
use super::ServerApi;
|
||||
use crate::{
|
||||
config::{packages::PackageType, ApiType, Config},
|
||||
error::*,
|
||||
};
|
||||
pub struct Forgejo;
|
||||
|
||||
#[async_trait]
|
||||
impl ServerApi for Forgejo {
|
||||
async fn init(&mut self, cfg: &Config) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_release(&mut self) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_pkg(&mut self, pkg_type: PackageType) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
impl Forgejo {
|
||||
pub async fn build(cfg: &Config) -> Result<Self> {
|
||||
todo!()
|
||||
}
|
||||
}
|
|
@ -1,27 +1,21 @@
|
|||
use async_trait::async_trait;
|
||||
|
||||
use super::ServerApi;
|
||||
use crate::{
|
||||
config::{packages::PackageType, ApiType, Config},
|
||||
error::*,
|
||||
};
|
||||
use crate::{config::Config, error::*};
|
||||
pub struct Gitea;
|
||||
|
||||
#[async_trait]
|
||||
impl ServerApi for Gitea {
|
||||
async fn init(&mut self, cfg: &Config) -> Result<()> {
|
||||
async fn init(&mut self, _cfg: &Config) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_release(&mut self) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_pkg(&mut self, pkg_type: PackageType) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
impl Gitea {
|
||||
pub async fn build(cfg: &Config) -> Result<Self> {
|
||||
pub async fn build(_cfg: &Config) -> Result<Self> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +1,21 @@
|
|||
use async_trait::async_trait;
|
||||
|
||||
use super::ServerApi;
|
||||
use crate::{
|
||||
config::{packages::PackageType, ApiType, Config},
|
||||
error::*,
|
||||
};
|
||||
use crate::{config::Config, error::*};
|
||||
pub struct Github;
|
||||
|
||||
#[async_trait]
|
||||
impl ServerApi for Github {
|
||||
async fn init(&mut self, cfg: &Config) -> Result<()> {
|
||||
async fn init(&mut self, _cfg: &Config) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_release(&mut self) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_pkg(&mut self, pkg_type: PackageType) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
impl Github {
|
||||
pub async fn build(cfg: &Config) -> Result<Self> {
|
||||
pub async fn build(_cfg: &Config) -> Result<Self> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +1,21 @@
|
|||
use async_trait::async_trait;
|
||||
|
||||
use super::ServerApi;
|
||||
use crate::{
|
||||
config::{packages::PackageType, ApiType, Config},
|
||||
error::*,
|
||||
};
|
||||
use crate::{config::Config, error::*};
|
||||
pub struct Gitlab;
|
||||
|
||||
#[async_trait]
|
||||
impl ServerApi for Gitlab {
|
||||
async fn init(&mut self, cfg: &Config) -> Result<()> {
|
||||
async fn init(&mut self, _cfg: &Config) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_release(&mut self) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_pkg(&mut self, pkg_type: PackageType) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
impl Gitlab {
|
||||
pub async fn build(cfg: &Config) -> Result<Self> {
|
||||
pub async fn build(_cfg: &Config) -> Result<Self> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
use async_trait::async_trait;
|
||||
|
||||
use crate::{
|
||||
config::{packages::PackageType, ApiType, Config},
|
||||
config::{ApiType, Config},
|
||||
error::*,
|
||||
};
|
||||
|
||||
pub mod forgejo;
|
||||
pub mod gitea;
|
||||
pub mod github;
|
||||
pub mod gitlab;
|
||||
use forgejo::*;
|
||||
use gitea::*;
|
||||
use github::*;
|
||||
use gitlab::*;
|
||||
|
@ -23,8 +21,6 @@ pub type ApiCollection = Vec<Box<dyn ServerApi>>;
|
|||
pub trait ServerApi {
|
||||
async fn init(&mut self, cfg: &Config) -> Result<()>;
|
||||
async fn push_release(&mut self) -> Result<()>;
|
||||
async fn push_release_artifact(&mut self) -> Result<()>;
|
||||
async fn push_pkg(&mut self, pkg_type: PackageType) -> Result<()>;
|
||||
}
|
||||
|
||||
pub async fn init_servers(cfg: &Config) -> Result<ApiCollection> {
|
||||
|
@ -40,9 +36,6 @@ pub async fn init_servers(cfg: &Config) -> Result<ApiCollection> {
|
|||
ApiType::Github => {
|
||||
collection.push(Box::new(Github::build(cfg).await?));
|
||||
}
|
||||
ApiType::Forgejo => {
|
||||
collection.push(Box::new(Forgejo::build(cfg).await?));
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(collection)
|
||||
|
|
Loading…
Add table
Reference in a new issue