Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4646b51459 | |||
| a72b7bc1e1 | |||
| 7aca648396 |
@@ -91,6 +91,11 @@ Current behavior:
|
|||||||
|
|
||||||
Do not manually hardcode release versions in the committed `meta.lsx` for each release if CI can derive them from tags.
|
Do not manually hardcode release versions in the committed `meta.lsx` for each release if CI can derive them from tags.
|
||||||
|
|
||||||
|
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`
|
||||||
|
- only after that commit the change and create/push the release tag
|
||||||
|
|
||||||
## info.json Expectations
|
## info.json Expectations
|
||||||
|
|
||||||
`info.json` is generated during build and should remain aligned with BG3/BG3ModManager expectations.
|
`info.json` is generated during build and should remain aligned with BG3/BG3ModManager expectations.
|
||||||
@@ -137,6 +142,8 @@ User preference:
|
|||||||
- commit messages should describe what was done, not what should be done
|
- commit messages should describe what was done, not what should be done
|
||||||
- if changes affect files that go into the final `.pak`, or change the build/release process, propose releasing the next version
|
- if changes affect files that go into the final `.pak`, or change the build/release process, propose releasing the next version
|
||||||
- if push fails, retry up to two more times with a 3-second pause between attempts
|
- if push fails, retry up to two more times with a 3-second pause between attempts
|
||||||
|
- when referring to a released version in user-facing messages, format the version as a direct link to the release archive whenever the archive URL can be derived
|
||||||
|
- it is acceptable to provide that archive link immediately after publishing the tag, even if the build is still running and the link may become valid a bit later
|
||||||
|
|
||||||
Do not auto-commit or auto-push without explicit user approval.
|
Do not auto-commit or auto-push without explicit user approval.
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<attribute id="Name" type="LSString" value="DnD 5.5e All-in-One BEYOND"/>
|
<attribute id="Name" type="LSString" value="DnD 5.5e All-in-One BEYOND"/>
|
||||||
<attribute id="PublishHandle" type="uint64" value="0"/>
|
<attribute id="PublishHandle" type="uint64" value="0"/>
|
||||||
<attribute id="UUID" type="guid" value="897914ef-5c96-053c-44af-0be823f895fe"/>
|
<attribute id="UUID" type="guid" value="897914ef-5c96-053c-44af-0be823f895fe"/>
|
||||||
<attribute id="Version64" type="int64" value="36028797018963968"/>
|
<attribute id="Version64" type="int64" value="281477124194304"/>
|
||||||
</node>
|
</node>
|
||||||
</children>
|
</children>
|
||||||
</node>
|
</node>
|
||||||
@@ -31,10 +31,10 @@
|
|||||||
<attribute id="PublishHandle" type="uint64" value="0"/>
|
<attribute id="PublishHandle" type="uint64" value="0"/>
|
||||||
<attribute id="StartupLevelName" type="FixedString" value=""/>
|
<attribute id="StartupLevelName" type="FixedString" value=""/>
|
||||||
<attribute id="UUID" type="FixedString" value="6401e84d-daf2-416d-adeb-99c03a2487a6"/>
|
<attribute id="UUID" type="FixedString" value="6401e84d-daf2-416d-adeb-99c03a2487a6"/>
|
||||||
<attribute id="Version64" type="int64" value="36028797018963968"/>
|
<attribute id="Version64" type="int64" value="281477124194304"/>
|
||||||
<children>
|
<children>
|
||||||
<node id="PublishVersion">
|
<node id="PublishVersion">
|
||||||
<attribute id="Version64" type="int64" value="36028797018963968"/>
|
<attribute id="Version64" type="int64" value="281477124194304"/>
|
||||||
</node>
|
</node>
|
||||||
</children>
|
</children>
|
||||||
</node>
|
</node>
|
||||||
|
|||||||
49
scripts/set-version.ps1
Normal file
49
scripts/set-version.ps1
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$VersionTag,
|
||||||
|
[string]$MetaPath = "Mods/DnD 5.5e AIO Russian/meta.lsx"
|
||||||
|
)
|
||||||
|
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
function Convert-VersionTagToVersion64 {
|
||||||
|
param(
|
||||||
|
[string]$Tag
|
||||||
|
)
|
||||||
|
|
||||||
|
$normalized = $Tag
|
||||||
|
if ($normalized.StartsWith("v")) {
|
||||||
|
$normalized = $normalized.Substring(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($normalized -notmatch '^\d+(\.\d+){0,3}$') {
|
||||||
|
throw "Version tag '$Tag' is invalid. Expected format: vX.Y.Z or X.Y.Z"
|
||||||
|
}
|
||||||
|
|
||||||
|
$parts = $normalized.Split(".")
|
||||||
|
$numbers = @(0, 0, 0, 0)
|
||||||
|
for ($i = 0; $i -lt $parts.Length; $i++) {
|
||||||
|
$numbers[$i] = [int]$parts[$i]
|
||||||
|
}
|
||||||
|
|
||||||
|
return ([int64]$numbers[0] -shl 55) -bor ([int64]$numbers[1] -shl 47) -bor ([int64]$numbers[2] -shl 31) -bor [int64]$numbers[3]
|
||||||
|
}
|
||||||
|
|
||||||
|
$resolvedMetaPath = [System.IO.Path]::GetFullPath($MetaPath)
|
||||||
|
if (-not (Test-Path -LiteralPath $resolvedMetaPath)) {
|
||||||
|
throw "meta.lsx was not found: '$resolvedMetaPath'."
|
||||||
|
}
|
||||||
|
|
||||||
|
$resolvedVersion64 = Convert-VersionTagToVersion64 -Tag $VersionTag
|
||||||
|
$metaContent = Get-Content -LiteralPath $resolvedMetaPath -Raw
|
||||||
|
|
||||||
|
$versionPattern = '(<attribute id="Version64" type="int64" value=")\d+("/>)'
|
||||||
|
if ($metaContent -notmatch $versionPattern) {
|
||||||
|
throw "Version64 attributes were not found in '$resolvedMetaPath'."
|
||||||
|
}
|
||||||
|
$updatedMeta = $metaContent -replace $versionPattern, "`${1}$resolvedVersion64`${2}"
|
||||||
|
|
||||||
|
$utf8Bom = New-Object System.Text.UTF8Encoding($true)
|
||||||
|
[System.IO.File]::WriteAllText($resolvedMetaPath, $updatedMeta, $utf8Bom)
|
||||||
|
|
||||||
|
Write-Host "[set-version.ps1] Updated '$resolvedMetaPath' to Version64=$resolvedVersion64 (from tag '$VersionTag')."
|
||||||
Reference in New Issue
Block a user