From 8a4970742c0df3db97a855866e82b0aa827a2c2e Mon Sep 17 00:00:00 2001 From: Shahovalov MIkhail Date: Thu, 9 Apr 2026 07:37:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BF=D1=80=D0=BE=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=83=D0=B1=D0=BB=D0=B8=D0=BA=D0=B0=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=B8=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D1=8F=D1=82=D1=8C?= =?UTF-8?q?=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20ModuleInfo/Version64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 6 ++++-- scripts/set-version.ps1 | 14 ++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index c78770d..a13385a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -93,9 +93,11 @@ Do not manually hardcode release versions in the committed `meta.lsx` for each r Release preparation rule: -- before creating a release tag, run `scripts/set-version.ps1 -VersionTag ` 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 `), then commit and only after that 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 diff --git a/scripts/set-version.ps1 b/scripts/set-version.ps1 index 765c29c..b30ccd1 100644 --- a/scripts/set-version.ps1 +++ b/scripts/set-version.ps1 @@ -37,11 +37,17 @@ if (-not (Test-Path -LiteralPath $resolvedMetaPath)) { $resolvedVersion64 = Convert-VersionTagToVersion64 -Tag $VersionTag $metaContent = Get-Content -LiteralPath $resolvedMetaPath -Raw -$versionPattern = '()' -if ($metaContent -notmatch $versionPattern) { - throw "Version64 attributes were not found in '$resolvedMetaPath'." +$moduleInfoVersionPattern = '(?s)(.*?)' +if ($metaContent -notmatch $moduleInfoVersionPattern) { + 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) [System.IO.File]::WriteAllText($resolvedMetaPath, $updatedMeta, $utf8Bom)