diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index a323217..115c586 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -28,4 +28,7 @@ jobs: context: . platforms: linux/amd64 push: true + build-args: | + VERSION=dev + COMMIT=${{ github.sha }} tags: ghcr.io/lone-cloud/prism:dev diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6470425..1e5a488 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,6 +70,9 @@ jobs: context: . platforms: linux/amd64,linux/arm64 push: true + build-args: | + VERSION=${{ steps.version.outputs.tag }} + COMMIT=${{ github.sha }} tags: | ghcr.io/lone-cloud/prism:${{ steps.version.outputs.tag }} ghcr.io/lone-cloud/prism:latest diff --git a/Dockerfile b/Dockerfile index c34a348..bb24e02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM golang:1.25-alpine3.23 AS builder +ARG VERSION=dev +ARG COMMIT=unknown + WORKDIR /build RUN apk add --no-cache git ca-certificates @@ -11,7 +14,7 @@ COPY . . RUN CGO_ENABLED=0 GOOS=linux go build \ -trimpath \ - -ldflags="-w -s -X main.version=$(cat VERSION 2>/dev/null || echo dev) -X main.commit=$(git rev-parse --short HEAD 2>/dev/null || echo unknown)" \ + -ldflags="-w -s -X main.version=${VERSION} -X main.commit=${COMMIT}" \ -o prism . FROM debian:trixie-slim @@ -35,7 +38,8 @@ COPY --from=builder /build/prism . RUN useradd -m -u 1000 prism && \ mkdir -p /app/data && \ - chown -R prism:prism /app + mkdir -p /home/prism/.local/share/signal-cli && \ + chown -R prism:prism /app /home/prism USER prism diff --git a/VERSION b/VERSION index 341cf11..7dff5b8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.0 \ No newline at end of file +0.2.1 \ No newline at end of file