Skip to content

Commit

Permalink
feat(ci): create query-server artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
gc-victor committed Nov 4, 2023
1 parent 2048d53 commit f2a77b5
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
22 changes: 10 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,28 @@ 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
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
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -92,21 +92,21 @@ lint:
# Release

build-server:
cargo build --package=server --release
cargo build --package=query-server --release

build-cli:
cargo build --package=query --profile dist

# 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
Expand Down
5 changes: 3 additions & 2 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ walkdir = "2"
version = "0.10"
features = ["vendored"]

[build]
incremental = true
[package.metadata.dist]
installers = ["shell", "powershell"]
targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-pc-windows-msvc"]
19 changes: 10 additions & 9 deletions crates/server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand All @@ -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
[package.metadata.dist]
installers = ["shell"]
targets = ["x86_64-unknown-linux-gnu"]
2 changes: 1 addition & 1 deletion litefs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f2a77b5

Please sign in to comment.