fix: pass SETUPTOOLS_SCM_PRETEND_VERSION to Docker build (#2582)

Co-authored-by: Nazim <nazim@openclaw.ai>
Co-authored-by: k9ert <117085+k9ert@users.noreply.github.com>
This commit is contained in:
al-munazzim 2026-04-02 14:50:01 +02:00 committed by GitHub
parent 15d5c414b5
commit fdea9325f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -36,7 +36,11 @@ jobs:
- name: Run Docker buildx
run: |
VERSION=${TAG#v}
PEP_VERSION=$(echo "$VERSION" | sed 's/-pre/rc/')
echo "Building with version: $PEP_VERSION"
docker buildx build \
--build-arg SETUPTOOLS_SCM_PRETEND_VERSION="$PEP_VERSION" \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/$IMAGE_NAME:$TAG \
--cache-from type=gha \

View file

@ -12,6 +12,7 @@ ARG DIR=/data/
FROM python:3.10-bookworm AS builder
ARG VERSION
ARG SETUPTOOLS_SCM_PRETEND_VERSION=""
ARG REPO
RUN apt update && apt install -y git libusb-1.0-0-dev libudev-dev libffi-dev libssl-dev rustc cargo libpq-dev
@ -28,7 +29,11 @@ RUN pip3 install -r requirements.txt
COPY . .
RUN pip3 install . --no-deps
RUN if [ -n "$SETUPTOOLS_SCM_PRETEND_VERSION" ]; then \
SETUPTOOLS_SCM_PRETEND_VERSION=$SETUPTOOLS_SCM_PRETEND_VERSION pip3 install . --no-deps; \
else \
pip3 install . --no-deps; \
fi
FROM python:3.10-slim-bookworm as final