mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +08:00
* feat: add nightly prerelease release flow and updater support * feat(ci): auto-generate nightly release notes from latest stable tag * fix(ci): correct nightly release notes heredoc YAML indentation * fix(ci): align nightly notes heredoc terminator * fix(ci): remove heredoc body indentation in nightly notes script * fix: align nightly release metadata and prerelease rules * fix: harden nightly release flow and updater release resolution * fix: improve nightly branch resolution and updater logging * fix: simplify updater target resolution and nightly release assets * fix: avoid inputs lookup on non-dispatch release events * fix: split nightly release fetch and simplify updater flow * refactor: simplify updater target resolvers and nightly error checks * fix: type release fetch errors and streamline updater resolution * refactor: simplify updater target branching and release artifacts * refactor: simplify release fetching and harden nightly git diagnostics * fix: validate release payload shape before parsing * refactor: harden prerelease handling and nightly constants * refactor: derive archive urls and enrich fetch errors * refactor: simplify update target resolution flow * refactor: linearize update target resolution * refactor: validate update target inputs and sync nightly tag source * refactor: simplify updater mode resolution and prerelease tests * refactor: simplify update target resolution flow * fix: avoid package import when resolving nightly tag * refactor: simplify updater resolution and centralize release constants * fix: harden nightly release notes generation in workflow * refactor: streamline update target resolution and errors * refactor: simplify updater target resolution and nightly handling * refactor: simplify updater errors and package release scripts * refactor: centralize release api constants and loader * fix(ci): resolve dispatch fallback tag from stable releases
50 lines
1.3 KiB
Python
50 lines
1.3 KiB
Python
import re
|
|
from pathlib import Path
|
|
|
|
from astrbot.core.release_constants import PRERELEASE_TAG_REGEX
|
|
|
|
|
|
def test_prerelease_rule_is_synced_with_dashboard():
|
|
repo_root = Path(__file__).resolve().parents[2]
|
|
vue_path = (
|
|
repo_root / "dashboard/src/layouts/full/vertical-header/VerticalHeader.vue"
|
|
)
|
|
content = vue_path.read_text(encoding="utf-8")
|
|
|
|
match = re.search(
|
|
r"const\s+PRE_RELEASE_TAG_REGEX\s*=\s*/(.+?)/([a-z]*)\s*;?",
|
|
content,
|
|
)
|
|
assert match is not None
|
|
vue_pattern, vue_flags = match.groups()
|
|
assert vue_pattern == PRERELEASE_TAG_REGEX.pattern
|
|
assert ("i" in vue_flags) == bool(PRERELEASE_TAG_REGEX.flags & re.IGNORECASE)
|
|
|
|
|
|
def test_prerelease_rule_matches_expected_examples():
|
|
prerelease_tags = (
|
|
"v1.2.3-alpha.1",
|
|
"v1.2.3-beta",
|
|
"v1.2.3-rc1",
|
|
"v1.2.3-dev",
|
|
"v1.2.3-nightly",
|
|
"v1.2.3-pre",
|
|
"v1.2.3-preview",
|
|
"v1.2.3-ALPHA",
|
|
"v1.2.3-Beta.1",
|
|
"v1.2.3-NIGHTLY",
|
|
)
|
|
stable_tags = (
|
|
"v1.2.3",
|
|
"v1.2.3+build.1",
|
|
"v1.2.3-release",
|
|
"v1.2.3-alphaish",
|
|
"v1.2.3-previewed",
|
|
)
|
|
|
|
for tag in prerelease_tags:
|
|
assert PRERELEASE_TAG_REGEX.search(tag) is not None
|
|
|
|
for tag in stable_tags:
|
|
assert PRERELEASE_TAG_REGEX.search(tag) is None
|