feat: switch versioning

This commit is contained in:
Lowder
2026-09-07 17:35:23 +05:00
parent ed82023d87
commit 04275dbb36
11 changed files with 420 additions and 236 deletions
+18
View File
@@ -0,0 +1,18 @@
"""Validate a component release tag against its Cargo manifest."""
import os
import sys
import tomllib
from pathlib import Path
component = sys.argv[1]
if component not in {"probe", "website", "reporter"}:
raise SystemExit(f"Unknown release component: {component}")
with Path(component, "Cargo.toml").open("rb") as manifest:
version = tomllib.load(manifest)["package"]["version"]
if os.environ.get("GITHUB_REF_TYPE") == "tag":
expected = f"{component}-v{version}"
actual = os.environ["GITHUB_REF_NAME"]
if actual != expected:
raise SystemExit(f"Tag {actual!r} does not match {component}/Cargo.toml; expected {expected!r}")
with open(os.environ["GITHUB_OUTPUT"], "a") as output:
output.write(f"version={version}\n")