From 42b645e355630464073a3cce8ee3723adc48fbb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=AD=A3=E8=B6=85?= Date: Sat, 19 Jul 2025 15:50:15 +0800 Subject: [PATCH] fix: robust Dockerfile version logic for v prefix handling (#262) * fix: robust Dockerfile version logic for v prefix handling * wip --- .github/workflows/build.yml | 2 +- Dockerfile | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3649cedd..630410e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -658,7 +658,7 @@ jobs: update-latest-version: name: Update Latest Version needs: [build-check, upload-release-assets] - if: startsWith(github.ref, 'refs/tags/') && needs.build-check.outputs.is_prerelease == 'false' + if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - name: Update latest.json diff --git a/Dockerfile b/Dockerfile index 85b39754..3ba1ac67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,8 +19,13 @@ RUN case "${TARGETARCH}" in \ arm64) ARCH="aarch64" ;; \ *) echo "Unsupported architecture: ${TARGETARCH}" >&2 && exit 1 ;; \ esac && \ + if [ "${RELEASE}" = "latest" ]; then \ + VERSION="latest"; \ + else \ + VERSION="v${RELEASE#v}"; \ + fi && \ BASE_URL="https://dl.rustfs.com/artifacts/rustfs/release" && \ - PACKAGE_NAME="rustfs-linux-${ARCH}-${RELEASE#v}.zip" && \ + PACKAGE_NAME="rustfs-linux-${ARCH}-${VERSION}.zip" && \ DOWNLOAD_URL="${BASE_URL}/${PACKAGE_NAME}" && \ echo "Downloading ${PACKAGE_NAME} from ${DOWNLOAD_URL}" >&2 && \ curl -f -L "${DOWNLOAD_URL}" -o rustfs.zip && \