From 76e5a166dca1789d2f5e8e696ad0a842ab8f0bac Mon Sep 17 00:00:00 2001 From: ddCat <2695092045@qq.com> Date: Mon, 31 Aug 2026 11:36:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E5=8F=91=E5=B8=83=E9=95=9C=E5=83=8F?= =?UTF-8?q?=20-=20=E6=94=AF=E6=8C=81=E5=9B=9B=E6=AE=B5=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E5=8E=9F=E6=A0=B7=E7=94=9F=E6=88=90=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish-images.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-images.yml b/.github/workflows/publish-images.yml index 05a456ff5..8b4f41b14 100644 --- a/.github/workflows/publish-images.yml +++ b/.github/workflows/publish-images.yml @@ -39,6 +39,12 @@ jobs: grep -Fqx "## $version" CHANGELOG.md || { echo "CHANGELOG.md is missing ## $version" >&2; exit 1; } fi echo "version=$version" >> "$GITHUB_OUTPUT" + echo "image_tag=${version#v}" >> "$GITHUB_OUTPUT" + if [[ "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([+-][0-9A-Za-z.-]+)?$ ]]; then + echo "is_semver=true" >> "$GITHUB_OUTPUT" + else + echo "is_semver=false" >> "$GITHUB_OUTPUT" + fi echo "build_time=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT" - name: Set up QEMU @@ -61,7 +67,8 @@ jobs: images: ghcr.io/${{ github.repository_owner }}/${{ matrix.image }} tags: | type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} - type=semver,pattern={{version}} + type=raw,value=${{ steps.build-info.outputs.image_tag }},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=semver,pattern={{version}},enable=${{ steps.build-info.outputs.is_semver == 'true' }} type=sha,prefix=sha- - name: Build and push image