Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3476112815 | |||
| ca2b0ec3a1 | |||
| 68d3f4f9a3 |
@@ -71,12 +71,20 @@ jobs:
|
|||||||
$workspace = "${{ gitea.workspace }}"
|
$workspace = "${{ gitea.workspace }}"
|
||||||
$refName = "${{ gitea.ref_name }}"
|
$refName = "${{ gitea.ref_name }}"
|
||||||
$archiveBaseName = "DnD 5.5e AIO Russian"
|
$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 = "Russian Localization"
|
||||||
|
$modAuthor = "MikhailRaw"
|
||||||
|
$modVersion64 = "36028797018963968"
|
||||||
|
$modGroup = "6401e84d-daf2-416d-adeb-99c03a2487a6"
|
||||||
if ($refName -and $refName -like "v*") {
|
if ($refName -and $refName -like "v*") {
|
||||||
$archiveBaseName = "DnD 5.5e AIO Russian $refName"
|
$archiveBaseName = "DnD 5.5e AIO Russian $refName"
|
||||||
}
|
}
|
||||||
$modsPath = [System.IO.Path]::GetFullPath((Join-Path $workspace "Mods"))
|
$sourcePath = [System.IO.Path]::GetFullPath($workspace)
|
||||||
$packagePath = [System.IO.Path]::GetFullPath((Join-Path $workspace "build/DnD 5.5e AIO Russian.pak"))
|
$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"))
|
$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 |
|
$divine = Get-ChildItem -Path ".tools/lslib" -Recurse -File |
|
||||||
Where-Object { $_.Name -ieq "Divine.exe" } |
|
Where-Object { $_.Name -ieq "Divine.exe" } |
|
||||||
Select-Object -First 1
|
Select-Object -First 1
|
||||||
@@ -85,17 +93,44 @@ jobs:
|
|||||||
throw "Divine.exe was not found in the downloaded LSLib release."
|
throw "Divine.exe was not found in the downloaded LSLib release."
|
||||||
}
|
}
|
||||||
|
|
||||||
& $divine.FullName -a create-package -g bg3 -s $modsPath -d $packagePath
|
& $divine.FullName -a create-package -g bg3 -s $sourcePath -d $packagePath
|
||||||
|
|
||||||
if (-not (Test-Path -LiteralPath "build/DnD 5.5e AIO Russian.pak")) {
|
if (-not (Test-Path -LiteralPath "build/DnD 5.5e AIO Russian.pak")) {
|
||||||
throw "Package was not created."
|
throw "Package was not created."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$packageFile = Get-Item -LiteralPath $packagePath
|
||||||
|
if ($packageFile.Length -lt 1024) {
|
||||||
|
throw "Package looks invalid: '$packagePath' is only $($packageFile.Length) bytes."
|
||||||
|
}
|
||||||
|
|
||||||
if (Test-Path -LiteralPath $zipPath) {
|
if (Test-Path -LiteralPath $zipPath) {
|
||||||
Remove-Item -LiteralPath $zipPath -Force
|
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 -Depth 4
|
||||||
|
|
||||||
|
Set-Content -LiteralPath $infoJsonPath -Value $infoJson -Encoding utf8
|
||||||
|
|
||||||
|
Compress-Archive -LiteralPath @($packagePath, $infoJsonPath) -DestinationPath $zipPath -CompressionLevel Optimal
|
||||||
|
|
||||||
if (-not (Test-Path -LiteralPath $zipPath)) {
|
if (-not (Test-Path -LiteralPath $zipPath)) {
|
||||||
throw "ZIP archive was not created."
|
throw "ZIP archive was not created."
|
||||||
@@ -112,7 +147,7 @@ jobs:
|
|||||||
}
|
}
|
||||||
$zipPath = [System.IO.Path]::GetFullPath((Join-Path $workspace "build/$archiveBaseName.zip"))
|
$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
|
Select-Object FullName, Length, LastWriteTime
|
||||||
|
|
||||||
- name: Publish archive to release
|
- name: Publish archive to release
|
||||||
|
|||||||
Reference in New Issue
Block a user