ci: a release candidate publishes only its own version tag

Only a stable-line release tag (vX.Y.Z, no pre-release suffix) moves the
public :alpha and sha-* image tags; a release candidate (vX.Y.Z-rc.N)
publishes its version tag alone. The workflow also runs only on version
tags and on a manual run from a version tag, never on a branch push.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pingqiuandClaude Opus 5.5 committed 2026-11-30 10:49:11 -08:00
1 parent e5a81f5ed4
commit 82498e840d
1 file changed
+15 -22
+15 -22
View File
@@ -39,33 +39,26 @@ jobs:
shell: bash
run: |
set -euo pipefail
# A release candidate (a version with a pre-release suffix, e.g. v1.0.1-rc.2) publishes only
# its own version tag. Only a stable-line release (e.g. v1.0.1) also moves :alpha and sha-*.
short_sha="${GITHUB_SHA::12}"
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
version="${GITHUB_REF_NAME}"
{
echo "block_tags<<EOF"
echo "${BLOCK_IMAGE}:${version}"
version="${GITHUB_REF_NAME}"
{
echo "block_tags<<EOF"
echo "${BLOCK_IMAGE}:${version}"
if [[ "${version}" != *-* ]]; then
echo "${BLOCK_IMAGE}:alpha"
echo "${BLOCK_IMAGE}:sha-${short_sha}"
echo "EOF"
echo "csi_tags<<EOF"
echo "${CSI_IMAGE}:${version}"
fi
echo "EOF"
echo "csi_tags<<EOF"
echo "${CSI_IMAGE}:${version}"
if [[ "${version}" != *-* ]]; then
echo "${CSI_IMAGE}:alpha"
echo "${CSI_IMAGE}:sha-${short_sha}"
echo "EOF"
} >> "$GITHUB_OUTPUT"
else
{
echo "block_tags<<EOF"
echo "${BLOCK_IMAGE}:alpha"
echo "${BLOCK_IMAGE}:sha-${short_sha}"
echo "EOF"
echo "csi_tags<<EOF"
echo "${CSI_IMAGE}:alpha"
echo "${CSI_IMAGE}:sha-${short_sha}"
echo "EOF"
} >> "$GITHUB_OUTPUT"
fi
fi
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Build and push block image
uses: docker/build-push-action@v6