From e320e4f88f236cd6b96878adfb5fe1349838f23d Mon Sep 17 00:00:00 2001 From: zzstoatzz Date: Sat, 28 Feb 2026 20:35:21 -0600 Subject: [PATCH] feat: cross-compile workflow + minimal Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit zig cross-compiles to x86_64-linux natively — no Docker emulation needed. Dockerfile is now just alpine + pre-built static binary. added Spindle CI workflow for format check + build verification. Co-Authored-By: Claude Opus 4.6 --- .tangled/workflows/ci.yml | 19 +++++++++++++++++++ Dockerfile | 12 ++---------- 2 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 .tangled/workflows/ci.yml diff --git a/.tangled/workflows/ci.yml b/.tangled/workflows/ci.yml new file mode 100644 index 0000000..bc3c1ac --- /dev/null +++ b/.tangled/workflows/ci.yml @@ -0,0 +1,19 @@ +when: + - event: ["push", "pull_request"] + branch: main + +engine: nixery + +dependencies: + nixpkgs: + - zig + - sqlite + +steps: + - name: check formatting + command: | + zig fmt --check . + + - name: build + command: | + zig build -Doptimize=ReleaseSafe --summary all diff --git a/Dockerfile b/Dockerfile index d5a8d93..9750682 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,6 @@ -FROM alpine:3.21 AS builder -RUN apk add --no-cache curl sqlite-dev xz musl-dev -RUN curl -L https://ziglang.org/download/0.15.2/zig-x86_64-linux-0.15.2.tar.xz | tar -xJ -C /usr/local -ENV PATH="/usr/local/zig-x86_64-linux-0.15.2:${PATH}" -WORKDIR /src -COPY . . -RUN zig build -Doptimize=ReleaseSafe - FROM alpine:3.21 -RUN apk add --no-cache sqlite-libs ca-certificates -COPY --from=builder /src/zig-out/bin/zlay /usr/local/bin/zlay +RUN apk add --no-cache ca-certificates +COPY zig-out/bin/zlay /usr/local/bin/zlay RUN mkdir -p /data/events ENV RELAY_DATA_DIR=/data/events ENV RELAY_DB_PATH=/data/relay.sqlite -- 2.51.2