Skip to content

Commit

Permalink
Merge pull request #855 from 4t145/fix-deps-version
Browse files Browse the repository at this point in the history
 prepare to release bios-iam package
  • Loading branch information
4t145 authored Oct 23, 2024
2 parents 07347b2 + d735b02 commit 90d0f2b
Show file tree
Hide file tree
Showing 83 changed files with 764 additions and 672 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/iam-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish bios-iam crate

on:
push:
tags:
- 'release-*'

jobs:
release-all:
runs-on: ubuntu-22.04
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Init rust environment
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- uses: davidB/rust-cargo-make@v1

- name: Cache rust
uses: Swatinem/rust-cache@v2

- name: Check format bios-basic
run: cargo fmt -p bios-basic -- --check
- name: Check format bios-iam
run: cargo fmt -p bios-iam -- --check
- name: Check clippy bios-basic
run: cargo clippy -p bios-basic --all-features
- name: Check clippy bios-basic
run: cargo clippy -p bios-basic --no-default-features
- name: Check clippy bios-iam
run: cargo clippy -p bios-iam --all-features
- name: Cargo login z
run: cargo login ${{ secrets.CRATES_TOKEN }}
- name: Package and Release
if: ${{ startsWith(github.ref, 'refs/tags/release') }}
run: cargo make publish-bios-iam
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
docker-images: false
swap-storage: false
android: true
dotnet: true
haskell: true
large-packages: true

- name: Upload to codecov.io
uses: codecov/codecov-action@v2
with:
token: ${{secrets.CODECOV_TOKEN}}

- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: cobertura.xml
16 changes: 9 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ members = [
]
resolver = "2"
[workspace.package]
version = "0.1.0"
version = "0.2.0"
authors = [
"gudaoxuri <[email protected]>",
"hermitCode <[email protected]>",
Expand Down Expand Up @@ -54,7 +54,7 @@ serde = { version = "1", features = ["derive"] }
serde_json = { version = "1" }
async-trait = { version = "0.1" }
lazy_static = { version = "1" }
itertools = { version = "0" }
itertools = { version = "0.13" }
fancy-regex = { version = "0" }
run_script = { version = "0.10" }
rust_decimal = { version = "1" }
Expand All @@ -63,19 +63,21 @@ testcontainers-modules = { version = "0.11", features = ["redis"] }
strum = { version = "0.26", features = ["derive"] }
# tardis
tardis = { version = "0.1.0-rc.17" }
# tardis = { path = "../tardis/tardis" }
# tardis = { version = "0.2.0", path = "../tardis/tardis" }
# tardis = { git = "https://github.com/ideal-world/tardis.git", rev = "9cc9b3e" }
# asteroid-mq = { git = "https://github.com/4t145/asteroid-mq.git", rev = "d59c64d" }
asteroid-mq = { git = "https://github.com/4t145/asteroid-mq.git", rev = "83a6643" }
asteroid-mq-sdk = { git = "https://github.com/4t145/asteroid-mq.git", rev = "83a6643" }
# asteroid-mq = { git = "https://github.com/4t145/asteroid-mq.git", rev = "83a6643" }
asteroid-mq = { version = "0.1.0-alpha.3" }
# asteroid-mq-sdk = { git = "https://github.com/4t145/asteroid-mq.git", rev = "83a6643" }
asteroid-mq-sdk = { version = "0.1.0-alpha.3" }
#spacegate

# spacegate-shell = { path = "../spacegate/crates/shell", features = [
# spacegate-shell = { version = "0.2.0", path = "../spacegate/crates/shell", features = [
# "cache",
# "k8s",
# "ext-axum",
# ] }
spacegate-shell = { git = "https://github.com/ideal-world/spacegate.git", branch = "master", features = [
spacegate-shell = { version="0.2.0-alpha.2", features = [
"cache",
"k8s",
"ext-axum",
Expand Down
59 changes: 59 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# ref: https://sagiegurari.github.io/cargo-make/
[env]
CARGO_MAKE_PROJECT_VERSION = "0.2.0"
PUBLISH_SCRIPT = "build-scripts/publish.sh"

[tasks.package-bios-basic]
workspace = false
command = "cargo"
args = ["package", "-p", "bios-basic"]

[tasks.publish-bios-basic]
dependencies = ["publish-bios-sdk-invoke", "package-bios-basic"]
workspace = false
command = "bash"
args = ["${PUBLISH_SCRIPT}", "${CARGO_MAKE_PROJECT_VERSION}", "bios-basic"]

[tasks.package-bios-iam]
workspace = false
command = "cargo"
args = ["package", "-p", "bios-iam"]

[tasks.publish-bios-iam]
dependencies = ["publish-bios-basic"]
workspace = false
command = "bash"
args = ["${PUBLISH_SCRIPT}", "${CARGO_MAKE_PROJECT_VERSION}", "bios-iam"]


[tasks.package-simple-invoke-client-macro]
workspace = false
command = "cargo"
args = ["package", "-p", "simple-invoke-client-macro"]

[tasks.publish-simple-invoke-client-macro]
workspace = false
command = "bash"
args = [
"${PUBLISH_SCRIPT}",
"${CARGO_MAKE_PROJECT_VERSION}",
"simple-invoke-client-macro",
]

[tasks.package-bios-sdk-invoke]
workspace = false
command = "cargo"
args = ["package", "-p", "bios-sdk-invoke"]

[tasks.publish-bios-sdk-invoke]
dependencies = ["publish-simple-invoke-client-macro"]
workspace = false
command = "bash"
args = ["${PUBLISH_SCRIPT}", "${CARGO_MAKE_PROJECT_VERSION}", "bios-sdk-invoke"]


[tasks.publish]
dependencies = ["publish-bios-iam"]
workspace = false
command = "echo"
args = ["Publishing completed!"]
24 changes: 8 additions & 16 deletions backend/basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,11 @@ name = "bios_basic"
path = "src/lib.rs"

[features]
default = [
"tardis",
"tardis/crypto",
"tardis/web-server",
"tardis/web-client",
"tardis/reldb-postgres",
"tardis/cache",
"tardis/mq",
]
default = []
# TODO remvoe
with-mq = ["tardis/mq"]
sdk = ["tardis", "tardis/web-client"]
test = ["tardis/test"]
with-mq = ["tardis/mq", "bios-sdk-invoke"]
sdk = ["tardis/web-client"]
test = ["tardis/test", "testcontainers-modules"]

[dependencies]
serde.workspace = true
Expand All @@ -36,14 +28,14 @@ async-recursion.workspace = true
lazy_static.workspace = true
itertools.workspace = true
fancy-regex.workspace = true
tardis = { workspace = true, optional = true }
tardis = { workspace = true, features = ["crypto", "reldb-postgres", "cache", "web-server", "web-client"] }
strum = { workspace = true }
testcontainers-modules = { workspace = true, features = ["redis"] }
bios-sdk-invoke = { path = "../../frontend/sdks/invoke", features = ["default"] }
testcontainers-modules = { workspace = true, features = ["redis"], optional = true }
bios-sdk-invoke = { version = "0.2.0", path = "../../frontend/sdks/invoke", features = ["default"], optional = true }

[dev-dependencies]
tardis = { workspace = true, features = ["test"] }
bios-sdk-invoke = { path = "../../frontend/sdks/invoke", features = ["default"] }
bios-sdk-invoke = { version = "0.2.0", path = "../../frontend/sdks/invoke", features = ["default"] }

[[test]]
name = "test_rbum"
Expand Down
4 changes: 2 additions & 2 deletions backend/basic/src/dto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ use serde::{Deserialize, Serialize};
use tardis::{basic::result::TardisResult, serde_json::Value};

use crate::enumeration::BasicQueryOpKind;
#[cfg(feature = "default")]

use tardis::web::poem_openapi;

/// Basic query condition object
///
/// 基础的查询条件对象
#[derive(Serialize, Deserialize, Debug, Clone)]
#[cfg_attr(feature = "default", derive(poem_openapi::Object))]
#[derive(poem_openapi::Object)]
pub struct BasicQueryCondInfo {
/// Query field
#[oai(validator(min_length = "1"))]
Expand Down
6 changes: 3 additions & 3 deletions backend/basic/src/enumeration.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//! Basic enumerations
use serde::{Deserialize, Serialize};
use strum::Display;
#[cfg(feature = "default")]

use tardis::web::poem_openapi;

/// API classification
///
/// API分类
#[derive(Display, Debug)]
#[cfg_attr(feature = "default", derive(poem_openapi::Tags))]
#[derive(poem_openapi::Tags)]
pub enum ApiTag {
/// Common Console, mostly starting with ``cc``, generally do not require authentication.
///
Expand Down Expand Up @@ -46,7 +46,7 @@ pub enum ApiTag {
///
/// 基础查询操作符
#[derive(Display, Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "default", derive(poem_openapi::Enum))]
#[derive(poem_openapi::Enum)]
pub enum BasicQueryOpKind {
#[oai(rename = "=")]
Eq,
Expand Down
4 changes: 2 additions & 2 deletions backend/basic/src/helper.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[cfg(feature = "default")]

pub mod db_helper;
#[cfg(feature = "default")]

pub mod request_helper;
2 changes: 1 addition & 1 deletion backend/basic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub trait TardisFunInstExtractor {
/// otherwise use the default configuration parameter.
///
/// 从请求路径中找到第一个路径段作为服务域名,如果存在与该服务域名同名的配置参数 ``csm.X``, 则使用该配置参数,否则使用默认配置参数.
#[cfg(feature = "default")]
impl TardisFunInstExtractor for tardis::web::poem::Request {
fn tardis_fun_inst(&self) -> TardisFunsInst {
let serv_domain = self.original_uri().path().split('/').collect::<Vec<&str>>()[1];
Expand Down
Loading

0 comments on commit 90d0f2b

Please sign in to comment.