mirror of
https://github.com/LowderPlay/cheburcheck.git
synced 2026-09-29 02:08:08 +03:00
feat: switch versioning
This commit is contained in:
@@ -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")
|
||||
Reference in New Issue
Block a user