Initial OfficeCom Sentinel client and deployment assets
This commit is contained in:
47
build/build-release-manifest.ps1
Normal file
47
build/build-release-manifest.ps1
Normal file
@@ -0,0 +1,47 @@
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[string]$ArtifactUrl,
|
||||
[string]$Channel = "stable",
|
||||
[string]$PackagePath = ".\artifacts\OCSentinelClient-win-x64.zip",
|
||||
[string]$OutputPath = ".\artifacts\version.json",
|
||||
[string]$MinUpdaterVersion = "1.0.0"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$repoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$projectPath = Join-Path $repoRoot "src\AttackTracerNinjaCli\AttackTracerNinjaCli.csproj"
|
||||
$packageFullPath = [System.IO.Path]::GetFullPath((Join-Path $repoRoot $PackagePath))
|
||||
$outputFullPath = [System.IO.Path]::GetFullPath((Join-Path $repoRoot $OutputPath))
|
||||
|
||||
if (-not (Test-Path $packageFullPath)) {
|
||||
throw "Package not found: $packageFullPath"
|
||||
}
|
||||
|
||||
[xml]$projectXml = Get-Content $projectPath
|
||||
$version = $projectXml.Project.PropertyGroup.Version | Select-Object -First 1
|
||||
if ([string]::IsNullOrWhiteSpace($version)) {
|
||||
$version = "0.0.0"
|
||||
}
|
||||
|
||||
$sha256 = (Get-FileHash -Path $packageFullPath -Algorithm SHA256).Hash.ToLowerInvariant()
|
||||
|
||||
$manifest = [ordered]@{
|
||||
channel = $Channel
|
||||
version = $version
|
||||
publishedAtUtc = (Get-Date).ToUniversalTime().ToString("o")
|
||||
artifactUrl = $ArtifactUrl
|
||||
sha256 = $sha256
|
||||
minUpdaterVersion = $MinUpdaterVersion
|
||||
}
|
||||
|
||||
$outputDirectory = Split-Path -Parent $outputFullPath
|
||||
if (-not [string]::IsNullOrWhiteSpace($outputDirectory)) {
|
||||
New-Item -ItemType Directory -Force -Path $outputDirectory | Out-Null
|
||||
}
|
||||
|
||||
$manifest | ConvertTo-Json -Depth 5 | Set-Content -Path $outputFullPath -Encoding UTF8
|
||||
|
||||
Write-Host "Release manifest written to $outputFullPath"
|
||||
Write-Host "Version: $version"
|
||||
Write-Host "SHA256: $sha256"
|
||||
Reference in New Issue
Block a user