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
This commit is contained in:
122 files changed
+6838
-22
No files matched your search
@@ -0,0 +1,214 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
DOTNET_NOLOGO: "1"
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"
|
||||
TOOLS: src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build and test (${{ matrix.os }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
global-json-file: global.json
|
||||
|
||||
- name: .NET info
|
||||
run: dotnet --info
|
||||
|
||||
- name: Restore fixtures cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: tests/fixtures/external
|
||||
key: fixtures-${{ hashFiles('tests/fixtures/manifest.json') }}
|
||||
|
||||
- name: Build (warnings are errors)
|
||||
run: dotnet build Titano.slnx -c Release
|
||||
|
||||
- name: Zero-package guard
|
||||
run: dotnet "$TOOLS" package-guard
|
||||
|
||||
- name: Localization check
|
||||
run: dotnet "$TOOLS" i18n check
|
||||
|
||||
- name: XAML lint
|
||||
run: dotnet "$TOOLS" xaml-lint
|
||||
|
||||
- name: Format check
|
||||
if: runner.os == 'Windows'
|
||||
run: dotnet format whitespace Titano.slnx --verify-no-changes
|
||||
|
||||
- name: Fetch CC0 fixtures
|
||||
continue-on-error: true
|
||||
run: |
|
||||
if dotnet "$TOOLS" --help | grep -q '^ fixtures'; then dotnet "$TOOLS" fixtures; fi
|
||||
|
||||
- name: Test · Core
|
||||
run: dotnet run --project tests/Titano.Core.Tests -c Release --no-build -- --junit out/junit/core.xml
|
||||
|
||||
- name: Test · Data (SQLite)
|
||||
run: dotnet run --project tests/Titano.Data.Tests -c Release --no-build -- --junit out/junit/data.xml
|
||||
|
||||
- name: Test · Server
|
||||
run: dotnet run --project tests/Titano.Server.Tests -c Release --no-build -- --junit out/junit/server.xml
|
||||
|
||||
- name: Test · Core.Windows
|
||||
if: runner.os == 'Windows'
|
||||
run: dotnet run --project tests/Titano.Core.Windows.Tests -c Release --no-build -- --junit out/junit/core-windows.xml
|
||||
|
||||
- name: Test · App
|
||||
if: runner.os == 'Windows'
|
||||
run: dotnet run --project tests/Titano.App.Tests -c Release --no-build -- --junit out/junit/app.xml
|
||||
|
||||
- name: Screenshots
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
src/Titano.App/bin/Release/net10.0-windows/Titano.exe --capture out/screenshots &
|
||||
wait $!
|
||||
ls -la out/screenshots
|
||||
|
||||
- name: Publish desktop programs (win-x64, self-contained single file)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
for p in Titano.App Titano.Uploader; do
|
||||
dotnet publish "src/$p/$p.csproj" -c Release -r win-x64 --self-contained \
|
||||
-p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true \
|
||||
-o "out/publish/$p"
|
||||
done
|
||||
dotnet publish src/Titano.Server/Titano.Server.csproj -c Release -r win-x64 --self-contained \
|
||||
-p:PublishSingleFile=true -o out/publish/Titano.Server
|
||||
|
||||
- name: Upload test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-results-${{ matrix.os }}
|
||||
path: out/junit/
|
||||
if-no-files-found: ignore
|
||||
|
||||
- name: Upload screenshots
|
||||
if: runner.os == 'Windows' && always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: screenshots
|
||||
path: out/screenshots/
|
||||
if-no-files-found: ignore
|
||||
|
||||
- name: Upload Windows programs
|
||||
if: runner.os == 'Windows'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: titano-win-x64-${{ github.sha }}
|
||||
path: out/publish/
|
||||
retention-days: 14
|
||||
|
||||
postgres:
|
||||
name: PostgreSQL ${{ matrix.pg }} integration
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
pg: ["16", "17"]
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:${{ matrix.pg }}
|
||||
env:
|
||||
POSTGRES_USER: titano
|
||||
POSTGRES_PASSWORD: titano-ci
|
||||
POSTGRES_DB: titano_test
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U titano -d titano_test"
|
||||
--health-interval 5s --health-timeout 5s --health-retries 20
|
||||
env:
|
||||
TITANO_TEST_PG: Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano;Password=titano-ci;SslMode=disable
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
global-json-file: global.json
|
||||
- name: Test · Data (PostgreSQL)
|
||||
run: dotnet run --project tests/Titano.Data.Tests -c Release -- --junit out/junit/data-pg${{ matrix.pg }}.xml
|
||||
- name: Upload test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-results-pg${{ matrix.pg }}
|
||||
path: out/junit/
|
||||
if-no-files-found: ignore
|
||||
|
||||
docker:
|
||||
name: Docker image
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17
|
||||
env:
|
||||
POSTGRES_USER: titano
|
||||
POSTGRES_PASSWORD: titano-ci
|
||||
POSTGRES_DB: titano
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U titano -d titano"
|
||||
--health-interval 5s --health-timeout 5s --health-retries 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- name: Build image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: deploy/docker/Dockerfile
|
||||
platforms: linux/amd64
|
||||
load: true
|
||||
push: false
|
||||
tags: titano-server:ci
|
||||
build-args: TITANO_VERSION=0.0.0-ci
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
- name: Smoke test (/health)
|
||||
run: |
|
||||
mkdir -p "$RUNNER_TEMP/archive" "$RUNNER_TEMP/data"
|
||||
docker run -d --name titano --network host \
|
||||
-e TITANO_DB_HOST=127.0.0.1 -e TITANO_DB_USER=titano -e TITANO_DB_PASSWORD=titano-ci -e TITANO_DB_NAME=titano \
|
||||
-e TITANO_ADMIN_USER=admin -e TITANO_ADMIN_PASSWORD=ci-password-1234 \
|
||||
-e PUID="$(id -u)" -e PGID="$(id -g)" \
|
||||
-v "$RUNNER_TEMP/archive:/archive" -v "$RUNNER_TEMP/data:/data" titano-server:ci
|
||||
for i in $(seq 1 60); do
|
||||
if curl -fsS http://127.0.0.1:8080/health; then echo; break; fi
|
||||
sleep 2
|
||||
done
|
||||
curl -fsS http://127.0.0.1:8080/api/v1/server/info
|
||||
curl -fsSk https://127.0.0.1:8443/health
|
||||
test "$(docker inspect --format '{{.State.Running}}' titano)" = "true"
|
||||
- name: Container logs
|
||||
if: always()
|
||||
run: docker logs titano || true
|
||||
@@ -0,0 +1,37 @@
|
||||
name: Nightly image
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "17 2 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
nightly:
|
||||
if: github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- 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
|
||||
tags: ${{ steps.image.outputs.name }}:nightly
|
||||
build-args: TITANO_VERSION=0.0.0-nightly.${{ github.run_number }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
@@ -0,0 +1,206 @@
|
||||
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
|
||||
Reference in new issue
Block a user