From f2a77b563839ea91e7fc551f9550f576676a796c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Garc=C3=ADa?= Date: Sat, 4 Nov 2023 07:16:21 +0100 Subject: [PATCH] feat(ci): create query-server artifact --- .github/workflows/release.yml | 4 ++-- Cargo.toml | 22 ++++++++++------------ Dockerfile | 6 +++--- Makefile | 10 +++++----- crates/cli/Cargo.toml | 5 +++-- crates/server/Cargo.toml | 19 ++++++++++--------- litefs.yml | 2 +- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c11dd68..28de66a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,7 +58,7 @@ jobs: with: submodules: recursive - name: Install cargo-dist - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.4.1/cargo-dist-installer.sh | sh" + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.4.2/cargo-dist-installer.sh | sh" - id: plan run: | cargo dist plan ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }} --output-format=json > dist-manifest.json @@ -140,7 +140,7 @@ jobs: with: submodules: recursive - name: Install cargo-dist - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.4.1/cargo-dist-installer.sh | sh" + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.4.2/cargo-dist-installer.sh | sh" # Get all the local artifacts for the global tasks to use (for e.g. checksums) - name: Fetch local artifacts uses: actions/download-artifact@v3 diff --git a/Cargo.toml b/Cargo.toml index 1563c9f3..68fc0718 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,13 +13,9 @@ license = "MIT" # Config for 'cargo dist' [workspace.metadata.dist] # The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax) -cargo-dist-version = "0.4.1" +cargo-dist-version = "0.4.2" # CI backends to support ci = ["github"] -# The installers to generate for each app -installers = ["shell", "powershell"] -# Target platforms to build apps for (Rust target-triple syntax) -targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-pc-windows-msvc"] # The archive format to use for non-windows builds (defaults .tar.xz) unix-archive = ".tar.gz" # Publish jobs to run in CI @@ -27,16 +23,18 @@ pr-run-mode = "plan" # Build only the required packages, and individually precise-builds = true +[profile.dev] +incremental = true + [profile.release] -lto = true -opt-level = 3 -strip="debuginfo" +codegen-units = 1 +lto = "thin" +opt-level = "s" +strip = true -# The profile that 'cargo dist' will build with [profile.dist] inherits = "release" -lto = "thin" -opt-level = "z" codegen-units = 1 -panic = "abort" +lto = "thin" +opt-level = "s" strip = true diff --git a/Dockerfile b/Dockerfile index 733beb1f..410c994f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,12 @@ WORKDIR /root RUN --mount=type=cache,target=/usr/local/cargo/registry COPY . . RUN --mount=type=cache,target=/usr/local/cargo/registry --mount=type=cache,target=/root/target \ - RUST_LOG=trace cargo build --package server --release && \ - mv /root/target/release/server /root + RUST_LOG=trace cargo build --package query-server --release && \ + mv /root/target/release/query-server /root FROM debian:12-slim AS runtime -COPY --from=builder /root/server / +COPY --from=builder /root/query-server / ADD litefs.yml /etc/litefs.yml COPY --from=flyio/litefs:0.5 /usr/local/bin/litefs /usr/local/bin/litefs diff --git a/Makefile b/Makefile index 51ea31ed..225c0469 100644 --- a/Makefile +++ b/Makefile @@ -58,14 +58,14 @@ dist-plan: # Docs docs: - cargo doc --package=server --open + cargo doc --package=query-server --open # Format fmt: fmt-server fmt-server: - cargo fmt --all --package=server -- --check + cargo fmt --all --package=query-server -- --check fmt-cli: cargo fmt --all --package=query -- --check @@ -92,7 +92,7 @@ lint: # Release build-server: - cargo build --package=server --release + cargo build --package=query-server --release build-cli: cargo build --package=query --profile dist @@ -100,13 +100,13 @@ build-cli: # Run run: - RUST_LOG=info cargo run --package=server -q | bunyan + RUST_LOG=info cargo run --package=query-server -q | bunyan run-cli: RUST_LOG=info cargo run --package=query run-release: - RUST_LOG=info cargo run --package=server --release -q | bunyan + RUST_LOG=info cargo run --package=query-server --release -q | bunyan run-cli-release: RUST_LOG=info cargo run --package=query --profile dist diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 4ae6192e..82957edd 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -37,5 +37,6 @@ walkdir = "2" version = "0.10" features = ["vendored"] -[build] -incremental = true \ No newline at end of file +[package.metadata.dist] +installers = ["shell", "powershell"] +targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-pc-windows-msvc"] diff --git a/crates/server/Cargo.toml b/crates/server/Cargo.toml index 85861caa..d956070a 100644 --- a/crates/server/Cargo.toml +++ b/crates/server/Cargo.toml @@ -1,23 +1,23 @@ [package] -name = "server" -version = "0.2.0" +name = "query-server" +version = "0.2.1-prerelease" authors.workspace = true edition.workspace = true license.workspace = true description = "Server for SQLite databases." homepage = "https://github.com/gc-victor/query/tree/main/crates/server" repository = "https://github.com/gc-victor/query" -publish = false [dependencies] anyhow = "1.0" argon2 = "0.5" chacha20poly1305 = { version = "0.10" } +deno_core = "0.225.0" dotenv = "0.15" hyper = { version = "0.14", features = ["full"] } -jsonwebtoken = "9.0" +jsonwebtoken = "9.1" rbase64 = "2.0" -regex = "1.9" +regex = "1.10" rusqlite = { version = "0.29", features = [ "bundled", "backup", @@ -28,7 +28,7 @@ rusqlite = { version = "0.29", features = [ "trace", "serde_json", ] } -rustyscript = { version = "0.1.2", features = ["all"] } +rustyscript = { version = "0.1.4", features = ["all"] } serde = { version = "1.0", features = ["derive"] } serde_bytes = "0.11" serde_json = "1.0" @@ -45,7 +45,8 @@ tracing-subscriber = { version = "0.3", features = [ "std", ] } url = "2.4" -uuid = { version = "1.4", features = ["v4"] } +uuid = { version = "1.5", features = ["v4"] } -[build] -incremental = true \ No newline at end of file +[package.metadata.dist] +installers = ["shell"] +targets = ["x86_64-unknown-linux-gnu"] diff --git a/litefs.yml b/litefs.yml index 51b91099..80d3db0c 100644 --- a/litefs.yml +++ b/litefs.yml @@ -42,7 +42,7 @@ exec: # if-candidate: true # Then run the application server on all nodes. - - cmd: "/server" + - cmd: "/query-server" proxy: # Specifies the bind address of the proxy server.