Automate Windows and Linux releases with Forgejo Actions
Some checks are pending
Release AstroFrame / packages (push) Waiting to run
Some checks are pending
Release AstroFrame / packages (push) Waiting to run
This commit is contained in:
parent
f971c374f8
commit
4e6d21de5a
9 changed files with 277 additions and 24 deletions
16
packaging/Build-ServerRelease.ps1
Normal file
16
packaging/Build-ServerRelease.ps1
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#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.' }
|
||||
& ./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."
|
||||
Loading…
Add table
Add a link
Reference in a new issue