diff --git a/.forgejo/build-service/action.yml b/.forgejo/build-service/action.yml new file mode 100644 index 0000000..6d71e5c --- /dev/null +++ b/.forgejo/build-service/action.yml @@ -0,0 +1,17 @@ +inputs: + service-name: + description: 'name of the service to build and upload' + required: true +runs: + using: "composite" + steps: + - uses: actions/checkout@v4 + - run: | + mkdir -pv artifacts + cargo build --release --bin ${{ inputs.service-name }} + mv target/release/${{ inputs.service-name }} artifacts/ + shell: bash + - uses: actions/upload-artifact@v3 + with: + name: "${{ inputs.service-name }}" + path: artifacts/ \ No newline at end of file diff --git a/.forgejo/workflows/build-all.yml b/.forgejo/workflows/build-all.yml new file mode 100644 index 0000000..1c3f550 --- /dev/null +++ b/.forgejo/workflows/build-all.yml @@ -0,0 +1,39 @@ +on: [push] +jobs: + build-all-services: + runs-on: docker + container: + image: hub.docker.com/_/rust:1-bookworm + steps: + - id: asklyphe-auth-frontend + uses: ./.forgejo/build-service + with: + service-name: "asklyphe-auth-frontend" + - id: asklyphe-frontend + uses: ./.forgejo/build-service + with: + service-name: "asklyphe-frontend" + - id: authservice + uses: ./.forgejo/build-service + with: + service-name: "authservice" + - id: bingservice + uses: ./.forgejo/build-service + with: + service-name: "bingservice" + - id: googleservice + uses: ./.forgejo/build-service + with: + service-name: "googleservice" + - id: lyphedb + uses: ./.forgejo/build-service + with: + service-name: "lyphedb" + - id: searchservice + uses: ./.forgejo/build-service + with: + service-name: "searchservice" + - id: vorebot + uses: ./.forgejo/build-service + with: + service-name: "vorebot" diff --git a/asklyphe-common/Cargo.toml b/asklyphe-common/Cargo.toml index 4ad48ed..39a9691 100644 --- a/asklyphe-common/Cargo.toml +++ b/asklyphe-common/Cargo.toml @@ -12,7 +12,7 @@ tokio = { version = "1.0", features = ["full"] } chrono = "0.4.31" serde = { version = "1.0", features = ["derive"] } lyphedb = { path = "../lyphedb" } -foundationdb = { version = "0.8.0", features = ["embedded-fdb-include"] } +foundationdb = { version = "0.8.0", features = ["embedded-fdb-include"], optional = true } log = "0.4.20" rmp-serde = "1.1.2" futures = "0.3.30" @@ -20,3 +20,6 @@ async-nats = "0.38.0" ulid = "1.1.0" rand = "0.8.5" percent-encoding = "2.3.1" + +[features] +default = [] \ No newline at end of file diff --git a/asklyphe-common/src/lib.rs b/asklyphe-common/src/lib.rs index d87c55c..6a914b9 100644 --- a/asklyphe-common/src/lib.rs +++ b/asklyphe-common/src/lib.rs @@ -16,6 +16,7 @@ pub mod db; pub mod ldb; pub use lyphedb; +#[cfg(feature = "foundationdb")] pub use foundationdb; pub fn add(left: usize, right: usize) -> usize { diff --git a/searchservice/Cargo.toml b/searchservice/Cargo.toml index 6167503..ad88aa4 100644 --- a/searchservice/Cargo.toml +++ b/searchservice/Cargo.toml @@ -8,7 +8,7 @@ license-file = "LICENSE" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -asklyphe-common = { path = "../asklyphe-common" } +asklyphe-common = { path = "../asklyphe-common", features = ["foundationdb"] } tokio = { version = "1.0", features = ["full"] } serde = { version = "1.0", features = ["derive"] } rmp-serde = "1.1.2"