diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 7b9359b..a8b2855 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -71,12 +71,20 @@ jobs: $workspace = "${{ gitea.workspace }}" $refName = "${{ gitea.ref_name }}" $archiveBaseName = "DnD 5.5e AIO Russian" + $modName = "DnD 5.5e All-in-One BEYOND Russian Localization" + $modFolder = "DnD 5.5e AIO Russian" + $modUuid = "6401e84d-daf2-416d-adeb-99c03a2487a6" + $modDescription = "Русская локализация мода DnD 5.5e All-in-One BEYOND." + $modAuthor = "MikhailRaw" + $modVersion64 = "36028797018963968" + $modGroup = "6401e84d-daf2-416d-adeb-99c03a2487a6" if ($refName -and $refName -like "v*") { $archiveBaseName = "DnD 5.5e AIO Russian $refName" } $modsPath = [System.IO.Path]::GetFullPath((Join-Path $workspace "Mods")) $packagePath = [System.IO.Path]::GetFullPath((Join-Path $workspace "build/DnD 5.5e AIO Russian.pak")) $zipPath = [System.IO.Path]::GetFullPath((Join-Path $workspace "build/$archiveBaseName.zip")) + $infoJsonPath = [System.IO.Path]::GetFullPath((Join-Path $workspace "build/info.json")) $divine = Get-ChildItem -Path ".tools/lslib" -Recurse -File | Where-Object { $_.Name -ieq "Divine.exe" } | Select-Object -First 1 @@ -95,7 +103,29 @@ jobs: Remove-Item -LiteralPath $zipPath -Force } - Compress-Archive -LiteralPath $packagePath -DestinationPath $zipPath -CompressionLevel Optimal + $packageMd5 = (Get-FileHash -LiteralPath $packagePath -Algorithm MD5).Hash.ToLowerInvariant() + $createdAt = (Get-Date).ToString("o") + + $infoJson = [ordered]@{ + Mods = @( + [ordered]@{ + Author = $modAuthor + Name = $modName + Folder = $modFolder + Version = $modVersion64 + Description = $modDescription + UUID = $modUuid + Created = $createdAt + Dependencies = @() + Group = $modGroup + } + ) + MD5 = $packageMd5 + } | ConvertTo-Json + + Set-Content -LiteralPath $infoJsonPath -Value $infoJson -Encoding utf8 + + Compress-Archive -LiteralPath @($packagePath, $infoJsonPath) -DestinationPath $zipPath -CompressionLevel Optimal if (-not (Test-Path -LiteralPath $zipPath)) { throw "ZIP archive was not created." @@ -112,7 +142,7 @@ jobs: } $zipPath = [System.IO.Path]::GetFullPath((Join-Path $workspace "build/$archiveBaseName.zip")) - Get-ChildItem "build/DnD 5.5e AIO Russian.pak", $zipPath | + Get-ChildItem "build/DnD 5.5e AIO Russian.pak", "build/info.json", $zipPath | Select-Object FullName, Length, LastWriteTime - name: Publish archive to release