Release v0.1.2
This commit is contained in:
+22
-3
@@ -26,6 +26,14 @@ try {
|
||||
}
|
||||
|
||||
$tag = 'v' + $Version
|
||||
$baseProfiles = Join-Path $root 'profiles.base.json'
|
||||
if (-not (Test-Path -LiteralPath $baseProfiles)) { throw 'Нет каталога базовых серверов profiles.base.json.' }
|
||||
if ((Get-Content -LiteralPath $baseProfiles -Raw) -match '"(?:private_key|local_address)"\s*:') {
|
||||
throw 'Базовый каталог содержит персональные поля WireGuard.'
|
||||
}
|
||||
foreach ($runtimeFile in @('bin\sb.exe', 'doc\doc.srs')) {
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $root $runtimeFile))) { throw "Нет обязательного файла $runtimeFile." }
|
||||
}
|
||||
& git show-ref --verify --quiet ("refs/tags/" + $tag)
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
$tagCommit = (& git rev-list -n 1 $tag).Trim()
|
||||
@@ -40,9 +48,13 @@ try {
|
||||
$stressRoot = Join-Path $dist ('stress-' + [guid]::NewGuid().ToString('N'))
|
||||
New-Item -ItemType Directory -Path $stressRoot | Out-Null
|
||||
$previousStressRoot = $env:SB_STRESS_ROOT
|
||||
$previousTemp = $env:TEMP
|
||||
$previousTmp = $env:TMP
|
||||
$env:SB_STRESS_ROOT = $stressRoot
|
||||
$env:TEMP = $stressRoot
|
||||
$env:TMP = $stressRoot
|
||||
try {
|
||||
foreach ($mode in @('staged', 'importtest', 'profiletest', 'stress')) {
|
||||
foreach ($mode in @('staged', 'importtest', 'profiletest', 'updatetest', 'stress', 'themetest')) {
|
||||
Write-Host "[*] build.cmd $mode"
|
||||
& $env:ComSpec /d /c build.cmd $mode
|
||||
if ($LASTEXITCODE -ne 0) { throw "Сборка или проверка $mode завершилась с ошибкой." }
|
||||
@@ -50,6 +62,8 @@ try {
|
||||
}
|
||||
finally {
|
||||
$env:SB_STRESS_ROOT = $previousStressRoot
|
||||
$env:TEMP = $previousTemp
|
||||
$env:TMP = $previousTmp
|
||||
$stressFull = [IO.Path]::GetFullPath($stressRoot)
|
||||
$distFull = [IO.Path]::GetFullPath($dist).TrimEnd('\') + '\'
|
||||
if ($stressFull.StartsWith($distFull, [StringComparison]::OrdinalIgnoreCase)) {
|
||||
@@ -75,10 +89,15 @@ try {
|
||||
New-Item -ItemType Directory -Path $stage | Out-Null
|
||||
try {
|
||||
Copy-Item -LiteralPath $exe -Destination (Join-Path $stage 'SbLauncher.exe')
|
||||
foreach ($name in @('Ui.xaml', 'README.md', 'CHANGELOG.md',
|
||||
'profiles.example.json', 'local.example.json')) {
|
||||
foreach ($name in @('Ui.xaml', 'README.md', 'CHANGELOG.md', 'HANDOFF.md',
|
||||
'profiles.base.json', 'profiles.example.json', 'local.example.json')) {
|
||||
Copy-Item -LiteralPath (Join-Path $root $name) -Destination $stage
|
||||
}
|
||||
foreach ($runtimeDir in @('bin', 'doc')) {
|
||||
New-Item -ItemType Directory -Path (Join-Path $stage $runtimeDir) | Out-Null
|
||||
}
|
||||
Copy-Item -LiteralPath (Join-Path $root 'bin\sb.exe') -Destination (Join-Path $stage 'bin\sb.exe')
|
||||
Copy-Item -LiteralPath (Join-Path $root 'doc\doc.srs') -Destination (Join-Path $stage 'doc\doc.srs')
|
||||
$templates = Join-Path $stage 'templates'
|
||||
New-Item -ItemType Directory -Path $templates | Out-Null
|
||||
foreach ($name in @('wg.json', 'direct.json', 'wgonly.json')) {
|
||||
|
||||
Reference in New Issue
Block a user