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
|
|
@ -50,7 +50,32 @@ The source is the repository's public Gitea releases API:
|
|||
|
||||
Only published stable release assets are consumed. Git commits by themselves do not trigger an update. End-user installations contain no repository write token. Packages use separate `win-x64` and `linux-x64` channels. Versions never downgrade automatically.
|
||||
|
||||
## Build release packages
|
||||
## Automatic server releases
|
||||
|
||||
`.forgejo/workflows/release.yml` uses the same `docker` runner label and `node:22-bookworm` container family as Decky's validation workflow. The job installs a .NET 10 SDK, the .NET 8 runtime used by the tests, and PowerShell 7.4.20 inside its disposable container. The Linux runner builds **both** the Windows Setup executable and Linux AppImage using Velopack's cross-platform packager; a Windows runner is not required for these unsigned installers.
|
||||
|
||||
Once this workflow is committed and pushed, enable Actions for the AstroFrame repository and ensure its Docker runner is available. No separate personal token is needed for the workflow: the publish step uses Forgejo's built-in repository-scoped Actions token. The server must allow that token to create releases. The existing personal-token publisher remains available for local use.
|
||||
|
||||
To release a new version:
|
||||
|
||||
```powershell
|
||||
./packaging/Set-Version.ps1 -Version 1.0.1
|
||||
git add Directory.Build.props
|
||||
git commit -m "Release 1.0.1"
|
||||
git push origin main
|
||||
git tag v1.0.1
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
The workflow tests Linux execution in Debian Bookworm; it creates Windows packages but cannot exercise their Windows UI. Windows desktop acceptance still needs a Windows machine. Upload/package failures appear in the Actions job log. Builds require outbound access to the Forgejo checkout action, Microsoft's SDK download endpoints and NuGet, plus enough disk space for both self-contained builds.
|
||||
|
||||
## Local package builds
|
||||
|
||||
Set the next stable version in `Directory.Build.props`. `-Version` can override it for a build. The application and package versions must match. A .NET 10 SDK/runtime is needed for the pinned Velopack CLI; the application itself targets .NET 8 and is published self-contained. Use PowerShell 7 for the release scripts.
|
||||
|
||||
|
|
@ -73,13 +98,13 @@ That script builds the Linux channel. The tool manifest pins Velopack CLI 1.2.16
|
|||
|
||||
Commit and push the versioned source first. The initial release has **not** been uploaded by this implementation. To make update discovery live, create a public stable release tagged `v1.0.0` and attach the files described below.
|
||||
|
||||
The helper script reads a Gitea repository-write token from `ASTROFRAME_RELEASE_TOKEN` in the process environment. It uploads both platforms into one draft, including the Linux installation helpers. It does not store the token or embed it in the application:
|
||||
The helper script reads a repository-write token from `ASTROFRAME_RELEASE_TOKEN` in the process environment. On the server this is supplied automatically by the workflow. For local publication, set your own Gitea/Forgejo repository-write token. The script uploads both platforms into one draft, including the Linux installation helpers. It does not store the token or embed it in the application:
|
||||
|
||||
```powershell
|
||||
./packaging/Publish.ps1
|
||||
```
|
||||
|
||||
Review the draft in Gitea and publish it there. For a deliberately immediate publication use `./packaging/Publish.ps1 -Publish`. The script refuses to modify an already published version. If a partial upload fails, delete the incomplete draft and retry, or attach the remaining files manually. Do not put the token in a script, commit, or command history.
|
||||
Review the draft in Gitea and publish it there. For a deliberately immediate publication use `./packaging/Publish.ps1 -Publish`. The script refuses to modify an already published version. A partial upload can be resumed by rerunning with the same packages: existing assets are downloaded and compared by SHA256 before skipping them. Conflicting bytes require explicitly removing the draft asset or the incomplete draft. Do not put the token in a script, commit, or command history.
|
||||
|
||||
For manual publication attach, from **both** channel folders:
|
||||
|
||||
|
|
@ -90,10 +115,12 @@ For manual publication attach, from **both** channel folders:
|
|||
|
||||
Keep older published releases available. The CLI can produce delta packages when previous packages are in the output folder. Full packages always support upgrading from older installs, even without a delta.
|
||||
|
||||
For later releases: change the version, validate, build, push the corresponding source, and publish a new stable tagged release with both channels. Existing installations then receive the notification and can update without reinstalling.
|
||||
For later releases, use the automatic tag workflow above, or validate/build/publish locally. Existing installations then receive the notification and can update without reinstalling.
|
||||
|
||||
## Verification
|
||||
|
||||
`./tools/Verify-ReleaseAutomation.ps1` exercises version/tag mismatch, upload failure, draft resumption, conflicting assets, immutable published releases and package integrity with a mocked release API. It never publishes a real release.
|
||||
|
||||
`tests/AstroFrame.Updates.Validation` covers settings recovery, network failures, concurrent checks, restart safety, save failure, real package checksums, corruption rejection and downgrade prevention. An optional release-feed argument adds real-package checks:
|
||||
|
||||
```powershell
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue