Files
Chronos/.github/workflows/release.yml
T
Claude c40b6a7cd3 feat: Phase 0 shells, design system, server skeleton, Docker and CI
- Titano.Ui: DESIGN.md tokens (dark/light), generated 16-px icon set,
  styles for all standard controls, custom chrome window with snap
  layouts, rail, job bar, Auto/manual slider, chips, toasts.
- Titano desktop shell with sections, Settings (language, theme),
  About and a --capture screenshot mode.
- Titano Server skeleton: env/server.json configuration, self-signed
  TLS with fingerprint, /health, /server/info, i18n endpoint and the
  embedded admin panel; in-process server tests.
- Docker image (multi-arch, PUID/PGID, health check), compose file,
  Unraid template; CI, release and nightly workflows; changelog tool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-02 09:35:03 +00:00

207 lines
8.8 KiB
YAML

name: Release
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: "Existing tag to (re)publish, e.g. v0.2.0"
required: true
permissions:
contents: write
packages: write
env:
DOTNET_NOLOGO: "1"
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
# Public repository that receives releases (BRIEF §19.4). Override with the RELEASES_REPO variable.
RELEASES_REPO: ${{ vars.RELEASES_REPO || format('{0}/titano-releases', github.repository_owner) }}
jobs:
version:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.v.outputs.tag }}
version: ${{ steps.v.outputs.version }}
prerelease: ${{ steps.v.outputs.prerelease }}
steps:
- id: v
run: |
tag="${{ github.event.inputs.tag || github.ref_name }}"
version="${tag#v}"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "version=$version" >> "$GITHUB_OUTPUT"
if [[ "$version" == *-* ]]; then echo "prerelease=true" >> "$GITHUB_OUTPUT"; else echo "prerelease=false" >> "$GITHUB_OUTPUT"; fi
windows:
needs: version
runs-on: windows-latest
defaults:
run:
shell: bash
env:
VERSION: ${{ needs.version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.version.outputs.tag }}
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Build and test
run: |
dotnet build Titano.slnx -c Release -p:TitanoVersion="$VERSION"
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: 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"
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
dotnet publish src/Titano.Setup/Titano.Setup.csproj $common -p:PublishReadyToRun=true -o out/publish/setup
- name: Sign binaries
if: env.SIGN_PFX != ''
env:
SIGN_PFX: ${{ secrets.SIGN_PFX_BASE64 }}
SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }}
shell: pwsh
run: |
$pfx = Join-Path $env:RUNNER_TEMP "sign.pfx"
[IO.File]::WriteAllBytes($pfx, [Convert]::FromBase64String($env:SIGN_PFX))
$signtool = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object FullName -Descending | Select-Object -First 1
Get-ChildItem out/publish -Recurse -Include *.exe | ForEach-Object {
& $signtool.FullName sign /fd SHA256 /f $pfx /p $env:SIGN_PASSWORD /tr http://timestamp.digicert.com /td SHA256 $_.FullName
if ($LASTEXITCODE -ne 0) { throw "signtool failed for $($_.FullName)" }
}
Remove-Item $pfx
- name: Package installers and archives
run: |
mkdir -p out/release
tools=src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll
dotnet "$tools" pack-installer --setup out/publish/setup/Titano.Setup.exe --product Titano \
--component "Titano=out/publish/app" --component "Uploader=out/publish/uploader" --component "Server=out/publish/server" \
--version "$VERSION" --out "out/release/Titano-Setup-$VERSION.exe"
dotnet "$tools" pack-installer --setup out/publish/setup/Titano.Setup.exe --product "Titano Uploader" \
--component "Uploader=out/publish/uploader" --version "$VERSION" --out "out/release/Titano-Uploader-Setup-$VERSION.exe"
(cd out/publish/server && 7z a -tzip "../../release/Titano-Server-win-x64-$VERSION.zip" . > /dev/null)
(cd out/publish/app && 7z a -tzip "../../release/Titano-win-x64-portable-$VERSION.zip" . > /dev/null)
- name: Sign installers
if: env.SIGN_PFX != ''
env:
SIGN_PFX: ${{ secrets.SIGN_PFX_BASE64 }}
SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }}
shell: pwsh
run: |
$pfx = Join-Path $env:RUNNER_TEMP "sign.pfx"
[IO.File]::WriteAllBytes($pfx, [Convert]::FromBase64String($env:SIGN_PFX))
$signtool = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object FullName -Descending | Select-Object -First 1
Get-ChildItem out/release -Filter *.exe | ForEach-Object { & $signtool.FullName sign /fd SHA256 /f $pfx /p $env:SIGN_PASSWORD /tr http://timestamp.digicert.com /td SHA256 $_.FullName }
Remove-Item $pfx
- name: Release notes
run: |
tag="${{ needs.version.outputs.tag }}"
previous="$(git describe --tags --abbrev=0 "$tag^" 2>/dev/null || true)"
range="${previous:+$previous..}$tag"
git log --format='%h%x09%s' "$range" | dotnet src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll changelog --title "Titano ${{ needs.version.outputs.version }}" --out out/release-notes.md
- uses: actions/upload-artifact@v4
with:
name: release-windows
path: |
out/release/
out/release-notes.md
docker:
needs: version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.version.outputs.tag }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image name
id: image
run: echo "name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/titano-server" >> "$GITHUB_OUTPUT"
- uses: docker/build-push-action@v6
with:
context: .
file: deploy/docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: TITANO_VERSION=${{ needs.version.outputs.version }}
tags: |
${{ 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-to: type=gha,mode=max
publish:
needs: [version, windows, docker]
runs-on: ubuntu-latest
env:
TAG: ${{ needs.version.outputs.tag }}
VERSION: ${{ needs.version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.version.outputs.tag }}
- uses: actions/download-artifact@v4
with:
name: release-windows
path: out
- name: Checksums
run: |
cd out/release
sha256sum * > SHA256SUMS
cat SHA256SUMS
- name: Create release in the public releases repository
if: env.RELEASES_TOKEN != ''
env:
RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN }}
GH_TOKEN: ${{ secrets.RELEASES_TOKEN }}
run: |
flags=""
if [ "${{ needs.version.outputs.prerelease }}" = "true" ]; then flags="--prerelease"; fi
gh release create "$TAG" out/release/* --repo "$RELEASES_REPO" --title "Titano $VERSION" --notes-file out/release-notes.md $flags
# Keep the Unraid template, icon and EULA in the public repository up to date.
git clone --depth 1 "https://x-access-token:${RELEASES_TOKEN}@github.com/${RELEASES_REPO}.git" public
mkdir -p public/unraid
cp deploy/unraid/titano.xml public/unraid/titano.xml
dotnet run --project src/Titano.Tools -c Release -- make-icon --out "$RUNNER_TEMP/icons"
cp "$RUNNER_TEMP/icons/titano-server-256.png" public/unraid/titano-server.png
if [ -f docs/legal/EULA.md ]; then cp docs/legal/EULA.md public/EULA.md; fi
cd public
git config user.name "titano-release"
git config user.email "titano-release@users.noreply.github.com"
git add -A
git diff --cached --quiet || git commit -m "chore: update Unraid template and assets for $TAG"
git push
- name: Create release in this repository (no RELEASES_TOKEN configured)
if: env.RELEASES_TOKEN == ''
env:
RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
flags=""
if [ "${{ needs.version.outputs.prerelease }}" = "true" ]; then flags="--prerelease"; fi
gh release create "$TAG" out/release/* --repo "$GITHUB_REPOSITORY" --title "Titano $VERSION" --notes-file out/release-notes.md $flags