fix(ci): 发布镜像 - 支持四段版本号原样生成镜像标签
This commit is contained in:
9
.github/workflows/publish-images.yml
vendored
9
.github/workflows/publish-images.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user