ci: let semver pre-release tags bypass strict manifest match

Tags matching `vX.Y.Z-*` (e.g. v3.4.0-rc1, v1.0.0-beta.2) are treated as
internal/staging builds. They skip the tag-vs-manifest check because
pre-releases do not flow to end users via `/plugin update`, which reads
the manifest on the default branch.

Stable tags `vX.Y.Z` still require all five version sources to match
exactly, so the protection against the #874 drift remains intact. The
cross-file consistency check on PRs is unchanged — all manifests must
still agree with mempalace/version.py whenever any version file moves.
This commit is contained in:
Igor Lins e Silva
2026-04-14 11:34:54 -03:00
parent 06240c73b3
commit 162edf39fe
+17 -1
View File
@@ -77,9 +77,25 @@ jobs:
run: |
set -euo pipefail
tag_version="${GITHUB_REF_NAME#v}"
# Semver pre-release tags (v3.4.0-rc1, v1.0.0-beta.2, ...) are treated
# as internal/staging and are not validated against the manifest. They
# do not flow to end users via `/plugin update`, which reads the
# manifest on the default branch.
if [[ "$tag_version" == *-* ]]; then
echo "Pre-release tag $GITHUB_REF_NAME — skipping strict manifest match."
{
echo ""
echo "> Pre-release tag detected: \`$GITHUB_REF_NAME\`."
echo "> Manifest ($PY) is not required to match. Pre-releases are not published via \`/plugin update\`."
} >> "$GITHUB_STEP_SUMMARY"
exit 0
fi
if [[ "$tag_version" != "$PY" ]]; then
echo "::error::tag $GITHUB_REF_NAME does not match manifest version $PY"
echo "Bump mempalace/version.py, pyproject.toml, and all plugin manifests before tagging."
echo "Bump mempalace/version.py, pyproject.toml, and all plugin manifests before tagging a stable release."
echo "For an internal/staging tag, use a semver pre-release suffix (e.g. v${PY}-rc1)."
exit 1
fi
echo "Tag $GITHUB_REF_NAME matches manifest version $PY"