ci(release): valid bug form, YAML check, embed the releases repository, keep public content on the newest release

- Quote the bug form's Version description (it did not parse, so GitHub offered no bug form at all).
- .github/scripts/check-yaml.rb parses workflows, the compose file and the public issue forms (and checks the form
  shape); CI runs it on Linux and the release job runs it before publishing the forms.
- Builds and publishes pass TitanoReleasesRepo=$RELEASES_REPO, so binaries read the repository they are published to.
- Image links in the public repository point to the image the docker job pushed.
- The public repository content follows the newest stable release; older tags and pre-releases only get their
  release, and an older stable tag is never marked Latest.
- Screenshot captures time out after 10 minutes; the perf summary reports missing timings.
- Public README names the in-app "Suggest a fix" link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 23:12:32 +00:00
1 parent b41755f326
commit aac2539276
7 files changed
+99 -17

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
# Parses YAML files and checks the shape of GitHub issue forms, so a broken workflow, compose file or issue form fails
# CI instead of being skipped by GitHub (an issue form that does not parse is simply not offered).
# Usage: ruby .github/scripts/check-yaml.rb FILE...
require "yaml"
def issue_form_problem(doc)
return "the form is not a mapping" unless doc.is_a?(Hash)
return "the form needs a name and a description" unless doc["name"].is_a?(String) && doc["description"].is_a?(String)
return "the form needs a body list" unless doc["body"].is_a?(Array) && !doc["body"].empty?
ids = []
doc["body"].each_with_index do |item, i|
return "body item #{i + 1} has no type" unless item.is_a?(Hash) && item["type"].is_a?(String)
attributes = item["attributes"]
return "body item #{i + 1} has no attributes" unless attributes.is_a?(Hash)
if item["type"] == "markdown"
return "markdown item #{i + 1} has no value" unless attributes["value"].is_a?(String)
else
return "body item #{i + 1} has no label" unless attributes["label"].is_a?(String)
ids << item["id"] if item["id"]
end
end
return "duplicate ids #{ids.tally.select { |_, n| n > 1 }.keys.join(', ')}" if ids.uniq.size != ids.size
nil
end
failures = 0
ARGV.each do |path|
doc = YAML.safe_load(File.read(path), aliases: true, filename: path)
if File.basename(File.dirname(path)) == "ISSUE_TEMPLATE" && File.basename(path) != "config.yml"
problem = issue_form_problem(doc)
raise problem if problem
end
puts "ok #{path}"
rescue StandardError => e
puts "::error file=#{path},title=YAML::#{e.message.lines.first.to_s.strip}"
failures += 1
end
exit(failures.zero? ? 0 : 1)
+6
View File
@@ -64,6 +64,11 @@ jobs:
if: runner.os == 'Windows' if: runner.os == 'Windows'
run: dotnet format whitespace Titano.slnx --verify-no-changes run: dotnet format whitespace Titano.slnx --verify-no-changes
# GitHub silently skips a workflow or issue form that does not parse; the public issue forms ship with releases.
- name: YAML check (workflows, compose, public issue forms)
if: runner.os == 'Linux'
run: ruby .github/scripts/check-yaml.rb .github/workflows/*.yml deploy/docker/docker-compose.yml deploy/releases-repo/.github/ISSUE_TEMPLATE/*.yml
# Missing samples become "RAW fixture missing" warning annotations; the tests that need them skip. # Missing samples become "RAW fixture missing" warning annotations; the tests that need them skip.
- name: Fetch CC0 fixtures - name: Fetch CC0 fixtures
run: dotnet "$TOOLS" fixtures --allow-missing run: dotnet "$TOOLS" fixtures --allow-missing
@@ -87,6 +92,7 @@ jobs:
- name: Screenshots - name: Screenshots
if: runner.os == 'Windows' if: runner.os == 'Windows'
timeout-minutes: 10
run: | run: |
set +e set +e
for exe in src/Titano.App/bin/Release/net10.0-windows/Titano.exe src/Titano.Uploader/bin/Release/net10.0-windows/Titano.Uploader.exe; do for exe in src/Titano.App/bin/Release/net10.0-windows/Titano.exe src/Titano.Uploader/bin/Release/net10.0-windows/Titano.Uploader.exe; do
+5 -1
View File
@@ -58,7 +58,11 @@ jobs:
{ {
echo "## Performance gates" echo "## Performance gates"
echo '```' echo '```'
grep -h "perf:" out-perf.log 2>/dev/null | sed 's/^ *//' || echo "no timings recorded" if grep -q "perf:" out-perf.log 2>/dev/null; then
grep -h "perf:" out-perf.log | sed 's/^ *//'
else
echo "no timings recorded"
fi
echo '```' echo '```'
} >> "$GITHUB_STEP_SUMMARY" } >> "$GITHUB_STEP_SUMMARY"
+38 -11
View File
@@ -24,7 +24,8 @@ env:
DOTNET_NOLOGO: "1" DOTNET_NOLOGO: "1"
DOTNET_CLI_TELEMETRY_OPTOUT: "1" DOTNET_CLI_TELEMETRY_OPTOUT: "1"
TOOLS: src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll TOOLS: src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll
# Public repository that receives releases (BRIEF §19.4). Override with the RELEASES_REPO repository variable. # Public repository that receives releases (BRIEF §19.4). Override with the RELEASES_REPO repository variable. Every
# build embeds it as TitanoReleasesRepo, so the update check, licence and issue links read the repository published to.
RELEASES_REPO: ${{ vars.RELEASES_REPO || format('{0}/titano-releases', github.repository_owner) }} RELEASES_REPO: ${{ vars.RELEASES_REPO || format('{0}/titano-releases', github.repository_owner) }}
jobs: jobs:
@@ -71,13 +72,14 @@ jobs:
- name: Build and test - name: Build and test
run: | run: |
dotnet build Titano.slnx -c Release -p:TitanoVersion="$VERSION" dotnet build Titano.slnx -c Release -p:TitanoVersion="$VERSION" -p:TitanoReleasesRepo="$RELEASES_REPO"
for t in Core Data Server Core.Windows App; do for t in Core Data Server Core.Windows App; do
dotnet run --project "tests/Titano.$t.Tests" -c Release --no-build -- --junit "out/junit/$t.xml" dotnet run --project "tests/Titano.$t.Tests" -c Release --no-build -- --junit "out/junit/$t.xml"
done done
- name: Screenshots for the public README - name: Screenshots for the public README
continue-on-error: true continue-on-error: true
timeout-minutes: 10
run: | run: |
for exe in src/Titano.App/bin/Release/net10.0-windows/Titano.exe src/Titano.Uploader/bin/Release/net10.0-windows/Titano.Uploader.exe; do for exe in src/Titano.App/bin/Release/net10.0-windows/Titano.exe src/Titano.Uploader/bin/Release/net10.0-windows/Titano.Uploader.exe; do
"$exe" --capture out/screenshots & "$exe" --capture out/screenshots &
@@ -87,7 +89,7 @@ jobs:
- name: Publish self-contained programs - name: Publish self-contained programs
run: | run: |
common="-c Release -r win-x64 --self-contained -p:TitanoVersion=$VERSION -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none" common="-c Release -r win-x64 --self-contained -p:TitanoVersion=$VERSION -p:TitanoReleasesRepo=$RELEASES_REPO -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none"
dotnet publish src/Titano.App/Titano.App.csproj $common -p:PublishReadyToRun=true -o out/publish/app dotnet publish src/Titano.App/Titano.App.csproj $common -p:PublishReadyToRun=true -o out/publish/app
dotnet publish src/Titano.Uploader/Titano.Uploader.csproj $common -p:PublishReadyToRun=true -o out/publish/uploader dotnet publish src/Titano.Uploader/Titano.Uploader.csproj $common -p:PublishReadyToRun=true -o out/publish/uploader
dotnet publish src/Titano.Server/Titano.Server.csproj $common -o out/publish/server dotnet publish src/Titano.Server/Titano.Server.csproj $common -o out/publish/server
@@ -232,20 +234,41 @@ jobs:
- name: Release target - name: Release target
id: target id: target
env:
GH_TOKEN: ${{ env.HAS_RELEASES_TOKEN == 'true' && secrets.RELEASES_TOKEN || secrets.GITHUB_TOKEN }}
run: | run: |
if [ "$HAS_RELEASES_TOKEN" = "true" ]; then if [ "$HAS_RELEASES_TOKEN" = "true" ]; then
echo "repo=$RELEASES_REPO" >> "$GITHUB_OUTPUT" repo="$RELEASES_REPO"
else else
echo "repo=$GITHUB_REPOSITORY" >> "$GITHUB_OUTPUT" repo="$GITHUB_REPOSITORY"
echo "::notice title=Release::RELEASES_TOKEN is not set: publishing to $GITHUB_REPOSITORY instead of $RELEASES_REPO (clients only see releases of $RELEASES_REPO)." echo "::notice title=Release::RELEASES_TOKEN is not set: publishing to $GITHUB_REPOSITORY instead of $RELEASES_REPO (clients only see releases of $RELEASES_REPO)."
fi fi
# The public content (README, EULA, i18n/, SHA256SUMS) follows the newest stable release, so re-publishing an
# older tag or publishing a pre-release never rolls it back; until a stable release exists, every tag updates it.
latest="$(gh release view --repo "$repo" --json tagName --jq .tagName 2>/dev/null || true)"
newest=true
if [ -n "$latest" ] && [ "$latest" != "$TAG" ]; then
if [ "$PRERELEASE" = "true" ] || [ "$(printf '%s\n%s\n' "${latest#v}" "$VERSION" | sort -V | tail -n 1)" != "$VERSION" ]; then
newest=false
fi
fi
echo "Latest release of $repo: ${latest:-none}; $TAG is the newest: $newest"
if [ "$newest" = "false" ]; then
echo "::notice title=Release::$TAG is older than $latest or a pre-release: the public repository content is left as it is."
fi
{
echo "repo=$repo"
echo "newest=$newest"
} >> "$GITHUB_OUTPUT"
- name: Validate the public issue forms
run: ruby .github/scripts/check-yaml.rb deploy/releases-repo/.github/ISSUE_TEMPLATE/*.yml
- name: Update the public releases repository - name: Update the public releases repository
if: env.HAS_RELEASES_TOKEN == 'true' if: env.HAS_RELEASES_TOKEN == 'true' && steps.target.outputs.newest == 'true'
env: env:
GH_TOKEN: ${{ secrets.RELEASES_TOKEN }} GH_TOKEN: ${{ secrets.RELEASES_TOKEN }}
run: | run: |
owner="${RELEASES_REPO%%/*}"
branch="$(gh api "repos/$RELEASES_REPO" --jq .default_branch)" branch="$(gh api "repos/$RELEASES_REPO" --jq .default_branch)"
git clone --depth 1 "https://x-access-token:${GH_TOKEN}@github.com/${RELEASES_REPO}.git" public git clone --depth 1 "https://x-access-token:${GH_TOKEN}@github.com/${RELEASES_REPO}.git" public
git -C public checkout -B "$branch" git -C public checkout -B "$branch"
@@ -261,9 +284,9 @@ jobs:
for shot in library jobs settings-rendering server uploader-queue; do for shot in library jobs settings-rendering server uploader-queue; do
if [ -f "out/screenshots/$shot-dark.png" ]; then cp "out/screenshots/$shot-dark.png" public/screenshots/; fi if [ -f "out/screenshots/$shot-dark.png" ]; then cp "out/screenshots/$shot-dark.png" public/screenshots/; fi
done done
# Links in the published files follow the configured repository and image owner. # Links in the published files follow the configured repository and the image the docker job pushed.
find public -path public/.git -prune -o -type f \( -name '*.md' -o -name '*.yml' -o -name '*.xml' \) -print0 | find public -path public/.git -prune -o -type f \( -name '*.md' -o -name '*.yml' -o -name '*.xml' \) -print0 |
xargs -0 -r sed -i -e "s#alby96/titano-releases#${RELEASES_REPO}#g" -e "s#ghcr.io/alby96/#ghcr.io/${owner,,}/#g" xargs -0 -r sed -i -e "s#alby96/titano-releases#${RELEASES_REPO}#g" -e "s#ghcr.io/alby96/titano-server#${IMAGE}#g"
cd public cd public
git config user.name "titano-release" git config user.name "titano-release"
git config user.email "titano-release@users.noreply.github.com" git config user.email "titano-release@users.noreply.github.com"
@@ -279,12 +302,16 @@ jobs:
env: env:
GH_TOKEN: ${{ env.HAS_RELEASES_TOKEN == 'true' && secrets.RELEASES_TOKEN || secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ env.HAS_RELEASES_TOKEN == 'true' && secrets.RELEASES_TOKEN || secrets.GITHUB_TOKEN }}
TARGET: ${{ steps.target.outputs.repo }} TARGET: ${{ steps.target.outputs.repo }}
NEWEST: ${{ steps.target.outputs.newest }}
run: | run: |
# An older stable tag published again must not become "Latest" (the update check reads releases/latest).
latest=()
if [ "$PRERELEASE" = "false" ] && [ "$NEWEST" = "false" ]; then latest=(--latest=false); fi
if gh release view "$TAG" --repo "$TARGET" > /dev/null 2>&1; then if gh release view "$TAG" --repo "$TARGET" > /dev/null 2>&1; then
gh release upload "$TAG" out/release/* --repo "$TARGET" --clobber gh release upload "$TAG" out/release/* --repo "$TARGET" --clobber
gh release edit "$TAG" --repo "$TARGET" --title "Titano $VERSION" --notes-file out/release-notes.md --prerelease="$PRERELEASE" gh release edit "$TAG" --repo "$TARGET" --title "Titano $VERSION" --notes-file out/release-notes.md --prerelease="$PRERELEASE" "${latest[@]}"
else else
gh release create "$TAG" out/release/* --repo "$TARGET" --title "Titano $VERSION" --notes-file out/release-notes.md --prerelease="$PRERELEASE" gh release create "$TAG" out/release/* --repo "$TARGET" --title "Titano $VERSION" --notes-file out/release-notes.md --prerelease="$PRERELEASE" "${latest[@]}"
fi fi
- name: Summary - name: Summary
+6 -3
View File
@@ -58,7 +58,7 @@ The server reads `/data/server.json` (`TITANO_DATA_PATH`) and `TITANO_*` environ
| Workflow | When | What | | Workflow | When | What |
|---|---|---| |---|---|---|
| `.github/workflows/ci.yml` | push to `main`, pull requests | Windows + Linux build (warnings are errors), all tests, package guard, i18n check, XAML lint, format check, CC0 fixtures (a warning per missing sample), screenshots (`--capture`, also pushed to the `ci-screenshots` branch for same-repository PRs), Windows program artifacts, PostgreSQL 16/17 integration, Docker image smoke test | | `.github/workflows/ci.yml` | push to `main`, pull requests | Windows + Linux build (warnings are errors), all tests, package guard, i18n check, XAML lint, format check, YAML check of workflows and public issue forms, CC0 fixtures (a warning per missing sample), screenshots (`--capture`, also pushed to the `ci-screenshots` branch for same-repository PRs), Windows program artifacts, PostgreSQL 16/17 integration, Docker image smoke test |
| `.github/workflows/docker.yml` | nightly | `ghcr.io/<owner>/titano-server:nightly` (multi-arch) | | `.github/workflows/docker.yml` | nightly | `ghcr.io/<owner>/titano-server:nightly` (multi-arch) |
| `.github/workflows/perf.yml` | weekly, manual | Performance gates on SQLite and PostgreSQL 17; timings in the job summary | | `.github/workflows/perf.yml` | weekly, manual | Performance gates on SQLite and PostgreSQL 17; timings in the job summary |
| `.github/workflows/release.yml` | tag `v*`, manual re-publish | The release (below) | | `.github/workflows/release.yml` | tag `v*`, manual re-publish | The release (below) |
@@ -75,7 +75,10 @@ The server reads `/data/server.json` (`TITANO_DATA_PATH`) and `TITANO_*` environ
zips `Titano-Server-win-x64-<v>.zip` and `Titano-win-x64-portable-<v>.zip`; zips `Titano-Server-win-x64-<v>.zip` and `Titano-win-x64-portable-<v>.zip`;
- writes release notes from the Conventional Commits since the previous tag (`Titano.Tools changelog`); - writes release notes from the Conventional Commits since the previous tag (`Titano.Tools changelog`);
- builds and pushes `ghcr.io/<owner>/titano-server:<v>` (and `:latest` for stable tags) for amd64 and arm64; - builds and pushes `ghcr.io/<owner>/titano-server:<v>` (and `:latest` for stable tags) for amd64 and arm64;
- computes `SHA256SUMS`, updates the public releases repository and creates (or updates) the GitHub release there. - computes `SHA256SUMS`, checks the public issue forms, updates the public releases repository and creates (or
updates) the GitHub release there. The repository content (README, EULA, `i18n/`, `SHA256SUMS`) follows the
newest stable release: a pre-release, or an older tag published again, only gets its release and never becomes
*Latest*. Until the first stable release exists, every tag updates the content.
4. To publish an existing tag again (for example after adding a secret), run *Release* manually with the tag. 4. To publish an existing tag again (for example after adding a secret), run *Release* manually with the tag.
### Secrets and variables ### Secrets and variables
@@ -83,7 +86,7 @@ The server reads `/data/server.json` (`TITANO_DATA_PATH`) and `TITANO_*` environ
| Name | Kind | Purpose | | Name | Kind | Purpose |
|---|---|---| |---|---|---|
| `RELEASES_TOKEN` | secret | Fine-grained PAT with *Contents: read and write* on the public releases repository. Without it the release is created in this (private) repository, which clients cannot see. | | `RELEASES_TOKEN` | secret | Fine-grained PAT with *Contents: read and write* on the public releases repository. Without it the release is created in this (private) repository, which clients cannot see. |
| `RELEASES_REPO` | variable (optional) | `owner/name` of the public repository; default `<owner>/titano-releases`. Builds embed it through the `TitanoReleasesRepo` MSBuild property (default `alby96/titano-releases`), so keep the two in line. | | `RELEASES_REPO` | variable (optional) | `owner/name` of the public repository; default `<owner>/titano-releases`. `release.yml` passes it to every build as the `TitanoReleasesRepo` MSBuild property, so the update check, licence and issue links of the binaries read the repository the release goes to (local builds default to `alby96/titano-releases`). |
| `SIGN_PFX_BASE64` | secret (optional) | Base64 of the Authenticode code-signing certificate (`.pfx`). Without it builds are unsigned. | | `SIGN_PFX_BASE64` | secret (optional) | Base64 of the Authenticode code-signing certificate (`.pfx`). Without it builds are unsigned. |
| `SIGN_PASSWORD` | secret (optional) | Password of that `.pfx`. | | `SIGN_PASSWORD` | secret (optional) | Password of that `.pfx`. |
+1 -1
View File
@@ -23,7 +23,7 @@ body:
id: version id: version
attributes: attributes:
label: Version label: Version
description: About shows it (server: admin panel › About, or /api/v1/server/info). description: "About shows it (server: admin panel › About, or /api/v1/server/info)."
placeholder: "0.2.0" placeholder: "0.2.0"
validations: validations:
required: true required: true
+1 -1
View File
@@ -100,7 +100,7 @@ Run `Titano.Server.exe` in a console, or install it as a Windows service from an
Titano is written in English and Italian; every other language is machine-translated and marked as such in Titano is written in English and Italian; every other language is machine-translated and marked as such in
About. The source strings are in [`i18n/`](i18n): `en/<Area>.resx` is the source, `<language>/<Area>.<language>.resx` About. The source strings are in [`i18n/`](i18n): `en/<Area>.resx` is the source, `<language>/<Area>.<language>.resx`
the translation. To suggest a correction, open a **Translation review** issue with the key, the current text and the translation. To suggest a correction, open a **Translation review** issue with the key, the current text and
your proposal — or the in-app *Review* link in About, which leads here. your proposal — or the in-app *Suggest a fix* link in About, which leads here.
## Verifying downloads ## Verifying downloads