rework the build system

- use rustls for reqwest, so we don't need to compile OpenSSL
- use better defaults for build arguments in Dockerfile
- add Continuous Integration workflow for master branch and it's pull requests
- add Release workflow for tags matching SemVer
- add release template for automatic release notes generation with GH CLI
- remove old and unused assets under .github
This commit is contained in:
Jonatan Czarniecki 2025-06-07 16:11:48 +02:00
parent 1c38c402b9
commit e21cbd1f63
No known key found for this signature in database
GPG key ID: 8B5FB251A803BDD0
13 changed files with 462 additions and 810 deletions

View file

@ -1,12 +1,12 @@
ARG ALPINE_VERSION="3.21"
ARG RUST_VERSION="1.85"
ARG ALPINE_VERSION=""
ARG RUST_VERSION="1"
## Chef
# defaults to rust:1-alpine
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-alpine${ALPINE_VERSION} AS chef
USER root
RUN apk add --no-cache musl-dev libressl-dev zig perl make
RUN cargo install --locked cargo-chef cargo-zigbuild
RUN apk add --no-cache musl-dev cargo-zigbuild
RUN cargo install --locked cargo-chef
WORKDIR /build
ENV PKG_CONFIG_SYSROOT_DIR=/
## Planner
FROM chef AS planner
@ -17,8 +17,8 @@ RUN cargo chef prepare --recipe-path recipe.json
## Builder
FROM chef AS builder
COPY --from=planner /build/recipe.json recipe.json
# Map Docker's TARGETPLATFORM to Rust's target
# and save the result to a .env file
# Map Docker's TARGETPLATFORM to Rust's build
# target and save the result to a .env file
ARG TARGETPLATFORM
RUN <<EOT
case "${TARGETPLATFORM}" in
@ -41,7 +41,7 @@ RUN . /tmp/builder.env && \
ln -s "$PWD/target/$CARGO_BUILD_TARGET/release" /tmp/build-output
## Runtime
FROM alpine:${ALPINE_VERSION} AS runtime
FROM alpine:${ALPINE_VERSION:-latest} AS runtime
WORKDIR /app
COPY --from=builder /tmp/build-output/sculptor /app/sculptor