Упростить правила публикации и обновлять только ModuleInfo/Version64

This commit is contained in:
2026-04-09 07:37:55 +03:00
parent b50a6a2f95
commit 8a4970742c
2 changed files with 14 additions and 6 deletions

View File

@@ -93,9 +93,11 @@ Do not manually hardcode release versions in the committed `meta.lsx` for each r
Release preparation rule: Release preparation rule:
- before creating a release tag, run `scripts/set-version.ps1 -VersionTag <tag>` to update repository `Mods/DnD 5.5e AIO Russian/meta.lsx` - use `ModuleInfo/Version64` in `meta.lsx` as the source of truth for release tagging
- if `meta.lsx` version was changed manually (for example via BG3 Toolkit), publish using a tag that matches this exact version
- if `meta.lsx` version still matches the latest released tag, first bump version in `meta.lsx` (for example via `scripts/set-version.ps1 -VersionTag <tag>`), then commit and only after that create/push the release tag
- only after that commit the change and create/push the release tag - only after that commit the change and create/push the release tag
- if `meta.lsx` version was changed manually (for example via BG3 Toolkit), publish using a tag that matches that exact version and do not use a different tag - `PublishVersion` must not be modified during release preparation
## info.json Expectations ## info.json Expectations

View File

@@ -37,11 +37,17 @@ 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
$versionPattern = '(<attribute id="Version64" type="int64" value=")\d+("/>)' $moduleInfoVersionPattern = '(?s)(<node id="ModuleInfo">.*?<attribute id="Version64" type="int64" value=")\d+("/>)'
if ($metaContent -notmatch $versionPattern) { if ($metaContent -notmatch $moduleInfoVersionPattern) {
throw "Version64 attributes were not found in '$resolvedMetaPath'." throw "ModuleInfo/Version64 attribute was not found in '$resolvedMetaPath'."
} }
$updatedMeta = $metaContent -replace $versionPattern, "`${1}$resolvedVersion64`${2}"
$updatedMeta = [regex]::Replace(
$metaContent,
$moduleInfoVersionPattern,
"`${1}$resolvedVersion64`${2}",
1
)
$utf8Bom = New-Object System.Text.UTF8Encoding($true) $utf8Bom = New-Object System.Text.UTF8Encoding($true)
[System.IO.File]::WriteAllText($resolvedMetaPath, $updatedMeta, $utf8Bom) [System.IO.File]::WriteAllText($resolvedMetaPath, $updatedMeta, $utf8Bom)