Исправлен set-version: обновление только ModuleInfo.Version64 и сужены правила в AGENTS
All checks were successful
Build Mod Package / build (push) Successful in 9s

This commit is contained in:
2026-04-09 08:47:39 +03:00
parent 70f93c3d29
commit 7f8f09a3ac
2 changed files with 10 additions and 2 deletions

View File

@@ -39,7 +39,7 @@
- CI triggers: tag `v*` and manual dispatch; not every push to `main`. - CI triggers: tag `v*` and manual dispatch; not every push to `main`.
## Version/Release Rules (MUST) ## Version/Release Rules (MUST)
- Source of truth for release version: `ModuleInfo/Version64` in `meta.lsx`. - Read release version only from `save/region/node[@id="ModuleSettings"]/children/node[@id="ModuleInfo"]/attribute[@id="Version64"]` via explicit XML parsing.
- `PublishVersion` must not be changed during release preparation. - `PublishVersion` must not be changed during release preparation.
- Release tag must match the source-of-truth version. - Release tag must match the source-of-truth version.
- Decision logic before tagging: - Decision logic before tagging:

View File

@@ -36,8 +36,16 @@ if (-not (Test-Path -LiteralPath $resolvedMetaPath)) {
$resolvedVersion64 = Convert-VersionTagToVersion64 -Tag $VersionTag $resolvedVersion64 = Convert-VersionTagToVersion64 -Tag $VersionTag
$metaContent = Get-Content -LiteralPath $resolvedMetaPath -Raw $metaContent = Get-Content -LiteralPath $resolvedMetaPath -Raw
[xml]$metaXml = $metaContent
$moduleInfoVersionPattern = '(?s)(<node id="ModuleInfo">.*?<attribute id="Version64" type="int64" value=")\d+("/>)' # Explicitly target ModuleInfo/Version64 via XML path to avoid touching Dependencies/PublishVersion.
$moduleInfoVersionNode = $metaXml.SelectSingleNode('/save/region/node/children/node[@id="ModuleInfo"]/attribute[@id="Version64" and @type="int64"]')
if ($null -eq $moduleInfoVersionNode) {
throw "ModuleInfo/Version64 attribute was not found in '$resolvedMetaPath'."
}
# Replace only the Version64 attribute that appears inside ModuleInfo before its <children> block.
$moduleInfoVersionPattern = '(?s)(<node id="ModuleInfo">\s*(?:(?!<children>).)*?<attribute id="Version64" type="int64" value=")\d+("/>)'
if ($metaContent -notmatch $moduleInfoVersionPattern) { if ($metaContent -notmatch $moduleInfoVersionPattern) {
throw "ModuleInfo/Version64 attribute was not found in '$resolvedMetaPath'." throw "ModuleInfo/Version64 attribute was not found in '$resolvedMetaPath'."
} }