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:
7 files changed
+99
-17
No files matched your search
@@ -64,6 +64,11 @@ jobs:
|
||||
if: runner.os == 'Windows'
|
||||
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.
|
||||
- name: Fetch CC0 fixtures
|
||||
run: dotnet "$TOOLS" fixtures --allow-missing
|
||||
@@ -87,6 +92,7 @@ jobs:
|
||||
|
||||
- name: Screenshots
|
||||
if: runner.os == 'Windows'
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
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
|
||||
|
||||
@@ -58,7 +58,11 @@ jobs:
|
||||
{
|
||||
echo "## Performance gates"
|
||||
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 '```'
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ env:
|
||||
DOTNET_NOLOGO: "1"
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
|
||||
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) }}
|
||||
|
||||
jobs:
|
||||
@@ -71,13 +72,14 @@ jobs:
|
||||
|
||||
- name: Build and test
|
||||
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
|
||||
dotnet run --project "tests/Titano.$t.Tests" -c Release --no-build -- --junit "out/junit/$t.xml"
|
||||
done
|
||||
|
||||
- name: Screenshots for the public README
|
||||
continue-on-error: true
|
||||
timeout-minutes: 10
|
||||
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
|
||||
"$exe" --capture out/screenshots &
|
||||
@@ -87,7 +89,7 @@ jobs:
|
||||
|
||||
- name: Publish self-contained programs
|
||||
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.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
|
||||
@@ -232,20 +234,41 @@ jobs:
|
||||
|
||||
- name: Release target
|
||||
id: target
|
||||
env:
|
||||
GH_TOKEN: ${{ env.HAS_RELEASES_TOKEN == 'true' && secrets.RELEASES_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
if [ "$HAS_RELEASES_TOKEN" = "true" ]; then
|
||||
echo "repo=$RELEASES_REPO" >> "$GITHUB_OUTPUT"
|
||||
repo="$RELEASES_REPO"
|
||||
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)."
|
||||
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
|
||||
if: env.HAS_RELEASES_TOKEN == 'true'
|
||||
if: env.HAS_RELEASES_TOKEN == 'true' && steps.target.outputs.newest == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.RELEASES_TOKEN }}
|
||||
run: |
|
||||
owner="${RELEASES_REPO%%/*}"
|
||||
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 -C public checkout -B "$branch"
|
||||
@@ -261,9 +284,9 @@ jobs:
|
||||
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
|
||||
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 |
|
||||
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
|
||||
git config user.name "titano-release"
|
||||
git config user.email "titano-release@users.noreply.github.com"
|
||||
@@ -279,12 +302,16 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ env.HAS_RELEASES_TOKEN == 'true' && secrets.RELEASES_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
TARGET: ${{ steps.target.outputs.repo }}
|
||||
NEWEST: ${{ steps.target.outputs.newest }}
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
- name: Summary
|
||||
|
||||
Reference in new issue
Block a user