AstroFrame/packaging/Build-ServerRelease.ps1
Elijah 0a6476d428
All checks were successful
Release AstroFrame / packages (push) Successful in 56s
Use Forgejo single-commit route and validate release publisher in CI
2026-10-03 19:50:21 -07:00

17 lines
1 KiB
PowerShell

#requires -Version 7.0
param([string]$Ref = $env:RELEASE_REF)
$ErrorActionPreference = 'Stop'
Set-Location (Split-Path $PSScriptRoot)
[xml]$props = Get-Content Directory.Build.props
$version = [string]$props.Project.PropertyGroup.Version
if ($version -notmatch '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$') { throw 'Directory.Build.props must contain a stable version such as 1.0.0.' }
if ($Ref -like 'refs/tags/*' -and $Ref -cne "refs/tags/v$version") {
throw "Release tag $Ref does not match version $version in Directory.Build.props."
}
if (!$Ref) { throw 'Supply the source ref, for example -Ref refs/tags/v1.0.0 or -Ref refs/heads/main for a build-only run.' }
Write-Output "Validating AstroFrame $version from $Ref"
& ./Build.ps1 -Test
if ($LASTEXITCODE) { throw 'Release validation failed.' }
& ./tools/Verify-ReleaseAutomation.ps1
& ./packaging/Release.ps1 -Version $version -Platform Both -PublishRoot artifacts/server-release/publish -Output artifacts/server-release/packages
Write-Output "Windows and Linux packages ready for AstroFrame $version."