Use Forgejo single-commit route and validate release publisher in CI
All checks were successful
Release AstroFrame / packages (push) Successful in 56s
All checks were successful
Release AstroFrame / packages (push) Successful in 56s
This commit is contained in:
parent
51fab803b3
commit
0a6476d428
4 changed files with 5 additions and 3 deletions
|
|
@ -69,7 +69,7 @@ git push origin v1.0.1
|
||||||
|
|
||||||
Include all intended source changes in the release commit before tagging. The pushed tag is the publication trigger; ordinary commits to `main` run the build and checks without publishing. The version in `Directory.Build.props` must exactly match the tag. For the first release, use `v1.0.0` after pushing this workflow and the finalized source.
|
Include all intended source changes in the release commit before tagging. The pushed tag is the publication trigger; ordinary commits to `main` run the build and checks without publishing. The version in `Directory.Build.props` must exactly match the tag. For the first release, use `v1.0.0` after pushing this workflow and the finalized source.
|
||||||
|
|
||||||
The job runs the engine and updater validation suites, builds both packages, renders the Linux settings page under Xvfb, then uploads everything into one draft release. Only after all uploads succeed does it make the release public, so users cannot discover an incomplete update. No local installer build or manual asset attachment is needed.
|
The job runs the engine, updater and release-publisher validation suites, builds both packages, renders the Linux settings page under Xvfb, then uploads everything into one draft release. Only after all uploads succeed does it make the release public, so users cannot discover an incomplete update. No local installer build or manual asset attachment is needed.
|
||||||
|
|
||||||
Use **Actions → Release AstroFrame → Run workflow** on `main` to verify runner setup without publishing. A manual run on a version tag publishes that version. Existing published releases cannot be overwritten. Interrupted uploads remain draft releases and can resume when matching build files are reused. If a fresh rebuild generates different bytes, the publisher reports the conflicting draft asset; remove the incomplete draft explicitly before rerunning. Do not delete an already published version.
|
Use **Actions → Release AstroFrame → Run workflow** on `main` to verify runner setup without publishing. A manual run on a version tag publishes that version. Existing published releases cannot be overwritten. Interrupted uploads remain draft releases and can resume when matching build files are reused. If a fresh rebuild generates different bytes, the publisher reports the conflicting draft asset; remove the incomplete draft explicitly before rerunning. Do not delete an already published version.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,6 @@ if (!$Ref) { throw 'Supply the source ref, for example -Ref refs/tags/v1.0.0 or
|
||||||
Write-Output "Validating AstroFrame $version from $Ref"
|
Write-Output "Validating AstroFrame $version from $Ref"
|
||||||
& ./Build.ps1 -Test
|
& ./Build.ps1 -Test
|
||||||
if ($LASTEXITCODE) { throw 'Release validation failed.' }
|
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
|
& ./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."
|
Write-Output "Windows and Linux packages ready for AstroFrame $version."
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ if ($LASTEXITCODE) { throw 'Cannot identify the release commit.' }
|
||||||
$status = @(& git status --porcelain)
|
$status = @(& git status --porcelain)
|
||||||
if ($LASTEXITCODE) { throw 'Cannot check release source status.' }
|
if ($LASTEXITCODE) { throw 'Cannot check release source status.' }
|
||||||
if ($status.Count -gt 0) { throw 'Commit the release source and push it before publishing.' }
|
if ($status.Count -gt 0) { throw 'Commit the release source and push it before publishing.' }
|
||||||
Invoke-RestMethod "$api/commits/$commit" -Headers $headers | Out-Null
|
Invoke-RestMethod "$api/git/commits/$commit" -Headers $headers | Out-Null
|
||||||
$tag = "v$Version"
|
$tag = "v$Version"
|
||||||
$remoteTag = $null
|
$remoteTag = $null
|
||||||
try { $remoteTag = Invoke-RestMethod "$api/tags/$tag" -Headers $headers }
|
try { $remoteTag = Invoke-RestMethod "$api/tags/$tag" -Headers $headers }
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@ function git {
|
||||||
function Invoke-RestMethod {
|
function Invoke-RestMethod {
|
||||||
param([string]$Uri, [string]$Method='Get', $Headers, [string]$ContentType, [string]$Body, $Form)
|
param([string]$Uri, [string]$Method='Get', $Headers, [string]$ContentType, [string]$Body, $Form)
|
||||||
$state.Calls++
|
$state.Calls++
|
||||||
if ($Uri -match '/commits/') { return @{ sha=('a'*40) } }
|
# Forgejo's single-commit route is /git/commits/{sha}; /commits/{sha} is a 404.
|
||||||
|
if ($Method -eq 'Get' -and $Uri -match '/git/commits/[0-9a-f]{40}$') { return @{ sha=('a'*40) } }
|
||||||
if ($Uri -match '/tags/' -and $Uri -notmatch '/releases/tags/') { return @{ commit=@{sha=$state.TagCommit} } }
|
if ($Uri -match '/tags/' -and $Uri -notmatch '/releases/tags/') { return @{ commit=@{sha=$state.TagCommit} } }
|
||||||
if ($Uri -match '/releases/tags/') {
|
if ($Uri -match '/releases/tags/') {
|
||||||
if (!$state.Created) { throw [Microsoft.PowerShell.Commands.HttpResponseException]::new('Not found', [Net.Http.HttpResponseMessage]::new([Net.HttpStatusCode]::NotFound)) }
|
if (!$state.Created) { throw [Microsoft.PowerShell.Commands.HttpResponseException]::new('Not found', [Net.Http.HttpResponseMessage]::new([Net.HttpStatusCode]::NotFound)) }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue