ci(release): push the image only after the tests, move :latest after the release

- The docker job waits for the Windows build and tests and pushes only :<v>;
  publish moves :latest with imagetools once the GitHub release exists and the
  tag is the newest stable one, so a failed or older re-published tag never
  moves it.
- The GitHub release is created before the public repository content, so the
  public SHA256SUMS never describes a release that does not exist.
- Stable release notes start from the previous stable tag.
- Raw links to the public repository follow its default branch.
- Public README and bug form name the Diagnostics row and its button.

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-03 10:07:18 +00:00
1 parent 03da77277c
commit 411425b83a
4 files changed
+64 -40

No files matched your search

+47 -26
View File
@@ -157,7 +157,12 @@ jobs:
env: env:
TAG: ${{ needs.version.outputs.tag }} TAG: ${{ needs.version.outputs.tag }}
run: | run: |
previous="$(git describe --tags --abbrev=0 "$TAG^" 2>/dev/null || true)" # A stable release lists everything since the previous stable one, not only what followed its last pre-release.
if [[ "$TAG" == *-* ]]; then
previous="$(git describe --tags --abbrev=0 "$TAG^" 2>/dev/null || true)"
else
previous="$(git describe --tags --abbrev=0 --exclude '*-*' "$TAG^" 2>/dev/null || true)"
fi
range="${previous:+$previous..}$TAG" range="${previous:+$previous..}$TAG"
git log --no-merges --format='%h%x09%s' "$range" | dotnet "$TOOLS" changelog --title "Titano $VERSION" --out out/release-notes.md git log --no-merges --format='%h%x09%s' "$range" | dotnet "$TOOLS" changelog --title "Titano $VERSION" --out out/release-notes.md
cat out/release-notes.md cat out/release-notes.md
@@ -171,8 +176,10 @@ jobs:
out/release-notes.md out/release-notes.md
out/screenshots/ out/screenshots/
# Pushes only the version tag, and only after the Windows job's tests passed; publish moves :latest once the GitHub
# release exists and the tag is the newest stable one.
docker: docker:
needs: version needs: [version, windows]
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
image: ${{ steps.image.outputs.name }} image: ${{ steps.image.outputs.name }}
@@ -197,9 +204,7 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: true push: true
build-args: TITANO_VERSION=${{ needs.version.outputs.version }} build-args: TITANO_VERSION=${{ needs.version.outputs.version }}
tags: | tags: ${{ steps.image.outputs.name }}:${{ needs.version.outputs.version }}
${{ steps.image.outputs.name }}:${{ needs.version.outputs.version }}
${{ needs.version.outputs.prerelease == 'false' && format('{0}:latest', steps.image.outputs.name) || '' }}
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
@@ -243,8 +248,9 @@ jobs:
repo="$GITHUB_REPOSITORY" 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 # The public content (README, EULA, i18n/, SHA256SUMS), the GitHub "Latest" marker and the image's :latest tag
# older tag or publishing a pre-release never rolls it back; until a stable release exists, every tag updates it. # follow the newest stable release, so re-publishing an older tag or publishing a pre-release never rolls them
# back; until a stable release exists, every tag updates the public content.
latest="$(gh release view --repo "$repo" --json tagName --jq .tagName 2>/dev/null || true)" latest="$(gh release view --repo "$repo" --json tagName --jq .tagName 2>/dev/null || true)"
newest=true newest=true
if [ -n "$latest" ] && [ "$latest" != "$TAG" ]; then if [ -n "$latest" ] && [ "$latest" != "$TAG" ]; then
@@ -254,7 +260,7 @@ jobs:
fi fi
echo "Latest release of $repo: ${latest:-none}; $TAG is the newest: $newest" echo "Latest release of $repo: ${latest:-none}; $TAG is the newest: $newest"
if [ "$newest" = "false" ]; then 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." echo "::notice title=Release::$TAG is older than $latest or a pre-release: the public repository content and :latest are left as they are."
fi fi
{ {
echo "repo=$repo" echo "repo=$repo"
@@ -264,6 +270,35 @@ jobs:
- name: Validate the public issue forms - name: Validate the public issue forms
run: ruby .github/scripts/check-yaml.rb deploy/releases-repo/.github/ISSUE_TEMPLATE/*.yml run: ruby .github/scripts/check-yaml.rb deploy/releases-repo/.github/ISSUE_TEMPLATE/*.yml
- name: GitHub release
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" "${latest[@]}"
else
gh release create "$TAG" out/release/* --repo "$TARGET" --title "Titano $VERSION" --notes-file out/release-notes.md --prerelease="$PRERELEASE" "${latest[@]}"
fi
- uses: docker/setup-buildx-action@v3
if: env.PRERELEASE == 'false' && steps.target.outputs.newest == 'true'
- uses: docker/login-action@v3
if: env.PRERELEASE == 'false' && steps.target.outputs.newest == 'true'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Move the image's latest tag
if: env.PRERELEASE == 'false' && steps.target.outputs.newest == 'true'
# Compose and Unraid users follow :latest; it moves only once the release exists, never back to an older server.
run: docker buildx imagetools create --tag "$IMAGE:latest" "$IMAGE:$VERSION"
- name: Update the public releases repository - name: Update the public releases repository
if: env.HAS_RELEASES_TOKEN == 'true' && steps.target.outputs.newest == 'true' if: env.HAS_RELEASES_TOKEN == 'true' && steps.target.outputs.newest == 'true'
env: env:
@@ -286,7 +321,8 @@ jobs:
done done
# Links in the published files follow the configured repository and the image the docker job pushed. # 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/titano-server#${IMAGE}#g" xargs -0 -r sed -i -e "s#alby96/titano-releases/main/#${RELEASES_REPO}/${branch}/#g" -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"
@@ -298,30 +334,15 @@ jobs:
git push origin "HEAD:$branch" git push origin "HEAD:$branch"
fi fi
- name: GitHub release
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" "${latest[@]}"
else
gh release create "$TAG" out/release/* --repo "$TARGET" --title "Titano $VERSION" --notes-file out/release-notes.md --prerelease="$PRERELEASE" "${latest[@]}"
fi
- name: Summary - name: Summary
env: env:
TARGET: ${{ steps.target.outputs.repo }} TARGET: ${{ steps.target.outputs.repo }}
NEWEST: ${{ steps.target.outputs.newest }}
run: | run: |
{ {
echo "## Titano $VERSION" echo "## Titano $VERSION"
echo "- Release: https://github.com/$TARGET/releases/tag/$TAG" echo "- Release: https://github.com/$TARGET/releases/tag/$TAG"
echo "- Image: \`$IMAGE:$VERSION\`$([ "$PRERELEASE" = "false" ] && echo " and \`:latest\`")" echo "- Image: \`$IMAGE:$VERSION\`$([ "$PRERELEASE" = "false" ] && [ "$NEWEST" = "true" ] && echo " and \`:latest\`")"
echo "- GHCR packages are private when first pushed and GitHub has no API to change that: once, open the" echo "- GHCR packages are private when first pushed and GitHub has no API to change that: once, open the"
echo " package settings of \`titano-server\` and set its visibility to **Public** (BRIEF §19.4)." echo " package settings of \`titano-server\` and set its visibility to **Public** (BRIEF §19.4)."
echo echo
+11 -9
View File
@@ -73,12 +73,14 @@ The server reads `/data/server.json` (`TITANO_DATA_PATH`) and `TITANO_*` environ
- publishes self-contained single-file programs, signs them when signing secrets exist, packs - publishes self-contained single-file programs, signs them when signing secrets exist, packs
`Titano-Setup-<v>.exe` and `Titano-Uploader-Setup-<v>.exe` (`Titano.Tools pack-installer`), signs the setups, `Titano-Setup-<v>.exe` and `Titano-Uploader-Setup-<v>.exe` (`Titano.Tools pack-installer`), signs the setups,
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`); a stable
- builds and pushes `ghcr.io/<owner>/titano-server:<v>` (and `:latest` for stable tags) for amd64 and arm64; tag starts from the previous stable tag, so its notes include what its release candidates brought;
- computes `SHA256SUMS`, checks the public issue forms, updates the public releases repository and creates (or - once the Windows tests passed, builds and pushes `ghcr.io/<owner>/titano-server:<v>` for amd64 and arm64;
updates) the GitHub release there. The repository content (README, EULA, `i18n/`, `SHA256SUMS`) follows the - computes `SHA256SUMS`, checks the public issue forms, creates (or updates) the GitHub release in the public
newest stable release: a pre-release, or an older tag published again, only gets its release and never becomes repository, then moves the image's `:latest` tag and updates the public repository content (README, EULA,
*Latest*. Until the first stable release exists, every tag updates the content. `i18n/`, `SHA256SUMS`). `:latest`, *Latest* and the content follow the newest stable release: a pre-release, or
an older tag published again, only gets its release and its `:<v>` image. 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
@@ -90,7 +92,7 @@ The server reads `/data/server.json` (`TITANO_DATA_PATH`) and `TITANO_*` environ
| `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`. |
`GITHUB_TOKEN` pushes the image to GHCR; no other secret is used. `GITHUB_TOKEN` pushes the image to GHCR and moves its `:latest` tag; no other secret is used.
### Bootstrapping the public releases repository ### Bootstrapping the public releases repository
@@ -100,8 +102,8 @@ The server reads `/data/server.json` (`TITANO_DATA_PATH`) and `TITANO_*` environ
it as the `RELEASES_TOKEN` secret of this repository. it as the `RELEASES_TOKEN` secret of this repository.
3. Push a pre-release tag (`v0.1.0-rc.1`). The release job copies `deploy/releases-repo/` (README, EULA draft, 3. Push a pre-release tag (`v0.1.0-rc.1`). The release job copies `deploy/releases-repo/` (README, EULA draft,
SECURITY policy, issue forms), the Unraid template and its icon, the compose file and `.env.example`, the dark SECURITY policy, issue forms), the Unraid template and its icon, the compose file and `.env.example`, the dark
screenshots, `i18n/` and the latest `SHA256SUMS` into the public repository, rewriting links to its name, then screenshots, `i18n/` and the latest `SHA256SUMS` into the public repository after creating the release with the
creates the release with the installers. installers, rewriting links to its name and default branch.
4. After the first image push, open the `titano-server` package on GHCR › *Package settings* and set its 4. After the first image push, open the `titano-server` package on GHCR › *Package settings* and set its
visibility to **Public** (GitHub offers no API for this; the release summary reminds you). visibility to **Public** (GitHub offers no API for this; the release summary reminds you).
5. Have the EULA draft (`deploy/releases-repo/EULA.md`) reviewed before the first stable release. 5. Have the EULA draft (`deploy/releases-repo/EULA.md`) reviewed before the first stable release.
+2 -2
View File
@@ -53,8 +53,8 @@ body:
attributes: attributes:
label: Diagnostics label: Diagnostics
description: | description: |
Desktop: Settings › Advanced › *Export bundle*, then drag the zip here. Server: admin panel › Logs › Desktop: Settings › Advanced › Diagnostics › *Export bundle* (or About › *Diagnostics bundle*), then drag the
*Diagnostics*. Bundles contain logs and system information, never photos, passwords or tokens; read them zip here. Server: admin panel › Logs › *Diagnostics*. Bundles contain logs and system information, never photos, passwords or tokens; read them
before sharing if your folder or host names are private. before sharing if your folder or host names are private.
- type: checkboxes - type: checkboxes
id: checks id: checks
+4 -3
View File
@@ -105,13 +105,14 @@ your proposal — or the in-app *Suggest a fix* link in About, which leads here.
## Verifying downloads ## Verifying downloads
Every release carries `SHA256SUMS`. On Linux or macOS: `sha256sum -c SHA256SUMS --ignore-missing`. Titano's Every release carries `SHA256SUMS`. On Linux or macOS: `sha256sum -c SHA256SUMS --ignore-missing`. Titano's
in-app update download performs the same check before showing the setup. Signed builds carry an Authenticode in-app update download performs the same check before showing the setup or portable zip. Signed builds carry an Authenticode
signature; unsigned builds may show a SmartScreen prompt. signature; unsigned builds may show a SmartScreen prompt.
## Support and security ## Support and security
- Bugs: open a **Bug report** issue (attach the diagnostics bundle from Settings › Advanced › *Export bundle*; it - Bugs: open a **Bug report** issue (attach the diagnostics bundle from Settings › Advanced › Diagnostics ›
contains logs and system information, never photos, passwords or tokens). *Export bundle*, or the server's from admin panel › Logs › *Diagnostics*; it contains logs and system information,
never photos, passwords or tokens).
- Security problems: see [SECURITY.md](SECURITY.md) — please do not open public issues for them. - Security problems: see [SECURITY.md](SECURITY.md) — please do not open public issues for them.
## Licence ## Licence