generated from PlexSheep/rs-base
automatic cargo CI changes
This commit is contained in:
parent
3e0d32721b
commit
a42393864e
|
@ -21,7 +21,7 @@ pub enum Error {
|
|||
#[error("Could not generate the changelog")]
|
||||
ChangelogError(#[from] ChangelogError),
|
||||
#[error("Server Api error")]
|
||||
ServerApiError(#[from] ServerApiError)
|
||||
ServerApiError(#[from] ServerApiError),
|
||||
}
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
|
@ -31,7 +31,7 @@ pub enum ServerApiError {
|
|||
#[error(transparent)]
|
||||
InvalidHeaderValue(#[from] reqwest::header::InvalidHeaderValue),
|
||||
#[error(transparent)]
|
||||
ReqwestErr(#[from] reqwest::Error)
|
||||
ReqwestErr(#[from] reqwest::Error),
|
||||
}
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
|
|
|
@ -7,10 +7,10 @@ pub struct ReleaseContext {
|
|||
pub repository: String,
|
||||
pub text: String,
|
||||
pub tag: String,
|
||||
pub commit_sig: String
|
||||
pub commit_sig: String,
|
||||
}
|
||||
|
||||
pub async fn release(cfg: &Config, apis: &mut ApiCollection) -> Result<()> {
|
||||
pub async fn release(cfg: &Config, _apis: &mut ApiCollection) -> Result<()> {
|
||||
// TODO: git tag
|
||||
// TODO: push to each server
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
use crate::{
|
||||
config::{packages::PackageType, Api, ApiType, Config},
|
||||
config::{Api, Config},
|
||||
error::*,
|
||||
serverapi::{PublishContext, ReleaseContext, ServerApi},
|
||||
};
|
||||
use async_trait::async_trait;
|
||||
use reqwest::{
|
||||
header::{HeaderMap, HeaderValue},
|
||||
Client, Method, Request, RequestBuilder, Url,
|
||||
Client, Url,
|
||||
};
|
||||
|
||||
pub struct Forgejo {
|
||||
|
@ -38,7 +38,7 @@ impl Forgejo {
|
|||
|
||||
#[async_trait]
|
||||
impl ServerApi for Forgejo {
|
||||
async fn init(&mut self, cfg: &Config) -> Result<()> {
|
||||
async fn init(&mut self, _cfg: &Config) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_release(&mut self, rc: &ReleaseContext) -> Result<()> {
|
||||
|
@ -65,14 +65,19 @@ impl ServerApi for Forgejo {
|
|||
.client
|
||||
.post(url)
|
||||
.body(body)
|
||||
.build().map_err(ServerApiError::from)?;
|
||||
let response = self.client.execute(request).await.map_err(ServerApiError::from)?;
|
||||
.build()
|
||||
.map_err(ServerApiError::from)?;
|
||||
let _response = self
|
||||
.client
|
||||
.execute(request)
|
||||
.await
|
||||
.map_err(ServerApiError::from)?;
|
||||
Ok(())
|
||||
}
|
||||
async fn push_release_artifact(&mut self, rc: &ReleaseContext) -> Result<()> {
|
||||
async fn push_release_artifact(&mut self, _rc: &ReleaseContext) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_pkg(&mut self, pc: &PublishContext) -> Result<()> {
|
||||
async fn push_pkg(&mut self, _pc: &PublishContext) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ use async_trait::async_trait;
|
|||
|
||||
use super::{PublishContext, ReleaseContext, ServerApi};
|
||||
use crate::{
|
||||
config::{packages::PackageType, Api, ApiType, Config},
|
||||
config::{Api, Config},
|
||||
error::*,
|
||||
};
|
||||
pub struct Gitea {
|
||||
|
@ -11,16 +11,16 @@ 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, rc: &ReleaseContext) -> Result<()> {
|
||||
async fn push_release(&mut self, _rc: &ReleaseContext) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_release_artifact(&mut self, rc: &ReleaseContext) -> Result<()> {
|
||||
async fn push_release_artifact(&mut self, _rc: &ReleaseContext) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_pkg(&mut self, pc: &PublishContext) -> Result<()> {
|
||||
async fn push_pkg(&mut self, _pc: &PublishContext) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ use async_trait::async_trait;
|
|||
|
||||
use super::{PublishContext, ReleaseContext, ServerApi};
|
||||
use crate::{
|
||||
config::{packages::PackageType, Api, ApiType, Config},
|
||||
config::{Api, Config},
|
||||
error::*,
|
||||
};
|
||||
pub struct Github {
|
||||
|
@ -11,16 +11,16 @@ 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, rc: &ReleaseContext) -> Result<()> {
|
||||
async fn push_release(&mut self, _rc: &ReleaseContext) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_release_artifact(&mut self, rc: &ReleaseContext) -> Result<()> {
|
||||
async fn push_release_artifact(&mut self, _rc: &ReleaseContext) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_pkg(&mut self, pc: &PublishContext) -> Result<()> {
|
||||
async fn push_pkg(&mut self, _pc: &PublishContext) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ use async_trait::async_trait;
|
|||
|
||||
use super::{PublishContext, ReleaseContext, ServerApi};
|
||||
use crate::{
|
||||
config::{packages::PackageType, Api, ApiType, Config},
|
||||
config::{Api, Config},
|
||||
error::*,
|
||||
};
|
||||
pub struct Gitlab {
|
||||
|
@ -11,16 +11,16 @@ 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, rc: &ReleaseContext) -> Result<()> {
|
||||
async fn push_release(&mut self, _rc: &ReleaseContext) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_release_artifact(&mut self, rc: &ReleaseContext) -> Result<()> {
|
||||
async fn push_release_artifact(&mut self, _rc: &ReleaseContext) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
async fn push_pkg(&mut self, pc: &PublishContext) -> Result<()> {
|
||||
async fn push_pkg(&mut self, _pc: &PublishContext) -> Result<()> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ pub async fn init_servers(cfg: &Config) -> Result<ApiCollection> {
|
|||
}
|
||||
}
|
||||
for api in collection.iter_mut() {
|
||||
api.init(&cfg).await?;
|
||||
api.init(cfg).await?;
|
||||
}
|
||||
Ok(collection)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue