update
This commit is contained in:
@@ -2,6 +2,7 @@ $projectRoot = $PSScriptRoot
|
||||
$azaVersionPy = Join-Path $projectRoot "aza_version.py"
|
||||
$manifestPath = Join-Path $projectRoot "release\version.json"
|
||||
$releaseBaseUrl = $env:AZA_RELEASE_BASE_URL
|
||||
$installerPath = Join-Path $projectRoot "dist\installer\aza_desktop_setup.exe"
|
||||
|
||||
if (-not (Test-Path $azaVersionPy)) {
|
||||
Write-Error "aza_version.py nicht gefunden: $azaVersionPy"
|
||||
@@ -31,27 +32,55 @@ if (Test-Path $manifestPath) {
|
||||
|
||||
$releaseDate = if ($manifest.release_date) { $manifest.release_date } else { (Get-Date).ToString("yyyy-MM-dd") }
|
||||
$minVersion = if ($manifest.minimum_supported_version) { $manifest.minimum_supported_version } else { $appVersion }
|
||||
$minRequired = if ($manifest.min_required_version) { $manifest.min_required_version } else { $minVersion }
|
||||
$downloadUrl = if ($releaseBaseUrl) {
|
||||
"$releaseBaseUrl/aza_desktop_setup.exe"
|
||||
} elseif ($manifest.download_url) {
|
||||
$manifest.download_url
|
||||
} else {
|
||||
"https://api.aza-medwork.ch/download/aza_desktop_setup.exe"
|
||||
"https://api.aza-medwork.ch/downloads/aza_desktop_setup.exe"
|
||||
}
|
||||
$installerType = if ($manifest.installer_type) { $manifest.installer_type } else { "inno-setup" }
|
||||
$releaseNotes = if ($manifest.release_notes) { $manifest.release_notes } else { @("Desktop-Build aktualisiert") }
|
||||
|
||||
$newManifest = [ordered]@{
|
||||
version = $appVersion
|
||||
channel = $appChannel
|
||||
release_date = $releaseDate
|
||||
minimum_supported_version = $minVersion
|
||||
download_url = $downloadUrl
|
||||
installer_type = $installerType
|
||||
release_notes = $releaseNotes
|
||||
$notesExisting = @()
|
||||
if ($manifest.notes -and $manifest.notes.Length -gt 0) {
|
||||
$notesExisting = @($manifest.notes)
|
||||
} elseif ($manifest.release_notes -and $manifest.release_notes.Length -gt 0) {
|
||||
$notesExisting = @($manifest.release_notes)
|
||||
}
|
||||
$notesList = if ($notesExisting.Count -gt 0) { $notesExisting } else { @("Desktop-Build aktualisiert") }
|
||||
$updateLevel = if ($manifest.update_level) { $manifest.update_level.ToString().ToLowerInvariant() } else { "recommended" }
|
||||
if ($updateLevel -ne "optional" -and $updateLevel -ne "recommended" -and $updateLevel -ne "required") {
|
||||
$updateLevel = "recommended"
|
||||
}
|
||||
|
||||
$newManifest | ConvertTo-Json -Depth 5 | Set-Content $manifestPath -Encoding UTF8
|
||||
$buildStamp = (Get-Date).ToString("yyyyMMdd_HHmmss")
|
||||
$sha256Hex = $null
|
||||
if (Test-Path $installerPath) {
|
||||
$buildStamp = (Get-Item $installerPath).LastWriteTime.ToString("yyyyMMdd_HHmmss")
|
||||
$sha256Hex = (Get-FileHash -Path $installerPath -Algorithm SHA256).Hash
|
||||
} elseif ($manifest.build) {
|
||||
$buildStamp = $manifest.build.ToString()
|
||||
}
|
||||
if (-not $sha256Hex -and $manifest.sha256) {
|
||||
$sha256Hex = $manifest.sha256.ToString()
|
||||
}
|
||||
|
||||
$newManifest = [ordered]@{
|
||||
version = $appVersion
|
||||
build = $buildStamp
|
||||
channel = $appChannel
|
||||
release_date = $releaseDate
|
||||
minimum_supported_version = $minVersion
|
||||
min_required_version = $minRequired
|
||||
download_url = $downloadUrl
|
||||
sha256 = $sha256Hex
|
||||
update_level = $updateLevel
|
||||
installer_type = $installerType
|
||||
notes = $notesList
|
||||
release_notes = $notesList
|
||||
}
|
||||
|
||||
$newManifest | ConvertTo-Json -Depth 6 | Set-Content $manifestPath -Encoding UTF8
|
||||
|
||||
if (-not $appVersion) {
|
||||
Write-Error "release/version.json konnte nicht erzeugt werden."
|
||||
@@ -59,8 +88,10 @@ if (-not $appVersion) {
|
||||
}
|
||||
|
||||
Write-Host "release/version.json aktualisiert."
|
||||
Write-Host "Version: $appVersion"
|
||||
Write-Host "Version: $appVersion Build: $buildStamp"
|
||||
if ($sha256Hex) {
|
||||
Write-Host "SHA256: $sha256Hex"
|
||||
}
|
||||
if ($releaseBaseUrl) {
|
||||
Write-Host "Download-URL Base: $releaseBaseUrl"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user