Allow alpha hotfix versions in R2 releases (#35595)

## Why

The Rust release workflow accepts alpha versions with a second numeric suffix,
such as `1.2.3-alpha.4.1`, but the R2 publisher rejects them as invalid.

## What changed

- Allow up to two numeric suffix components for alpha versions in
  `publish_r2_release.py`.
- Document that its version pattern must remain aligned with release tag
  validation in `rust-release.yml`.

GitOrigin-RevId: 8df68ce4f4d3e652367f7394a642827f21979d70
This commit is contained in:
zsol-openai
2026-07-27 10:46:58 +00:00
committed by Adam Perry
parent 7d8f840fee
commit fbb0bf282a
2 changed files with 8 additions and 1 deletions

View File

@@ -30,7 +30,12 @@ PREFIX = "codex"
REPOSITORY = "openai/codex"
RELEASE_METADATA_NAME = "release.json"
INSTALLER_NAMES = ("install.sh", "install.ps1")
VERSION_RE = re.compile(r"^[0-9]+\.[0-9]+\.[0-9]+(?:-(?:alpha|beta)(?:\.[0-9]+)?)?$")
# Keep this pattern in sync with release-tag validation in
# .github/workflows/rust-release.yml.
VERSION_RE = re.compile(
r"^[0-9]+\.[0-9]+\.[0-9]+(?:-(?:alpha(?:\.[0-9]+){0,2}"
r"|beta(?:\.[0-9]+)?))?$"
)
CRC64_RE = re.compile(r"^[A-Za-z0-9+/]{11}=$")
SHA256_RE = re.compile(r"^sha256:([0-9a-f]{64})$")