CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
The owner renamed the product and moved the repository to the self-hosted Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control, and asked for Actions and a first automatic release with the server package and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md). - Chronos everywhere: a byte-exact rename of contents and paths, then a per-language review of the forms the old name's ending had dictated. - Gitea instead of GitHub: the update check, licence, issue and support links read ChronosReleasesUrl; the update check takes the highest stable version, offers a pre-release build its final release and reports a repository it cannot see as a failed check. EULA, security policy and Gitea issue forms live at the repository root. - Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release, nightly image and performance gates in the .NET SDK container with git checkout and the system SQLite. The release cross-compiles the Windows programs, checks their icon, version and DPI manifest, packs installers and zips, publishes the Gitea release and pushes the server image (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows runner (WINDOWS_RUNNER). - New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the docker-exec script, which Gitea's service containers do not allow; the throw-away server runs without durability) and pe-check. - Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR, 3 on the shared runner; the weekly performance gates keep theirs). BREAKING CHANGE: programs, settings, data folders, file types, environment variables and the Docker image use the new name; nothing is migrated from Titano, which never had a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
310 lines
17 KiB
YAML
310 lines
17 KiB
YAML
name: Release
|
|
|
|
# A tag vMAJOR.MINOR.PATCH[-PRERELEASE] builds, tests and publishes everything (BRIEF §19.3, amended 2026-10-23, R3)
|
|
# on the Linux runner: the Windows programs cross-compiled (installers, portable and server zips), SHA256SUMS and
|
|
# release notes on the Gitea release, then the server image in the Gitea container registry. Pre-releases get no
|
|
# :latest image and are ignored by the in-app update check.
|
|
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"
|
|
TOOLS: src/Chronos.Tools/bin/Release/net10.0/Chronos.Tools.dll
|
|
BUILD_CPUS: "4"
|
|
# Timed tests get three times their budget on the shared runner (Chronos.Testing TestTiming, as in ci.yml).
|
|
CHRONOS_TEST_TIME_FACTOR: "3"
|
|
TAG: ${{ github.event.inputs.tag || github.ref_name }}
|
|
# Where people and programs reach Gitea (the runner itself uses github.server_url). Variable PUBLIC_URL overrides it.
|
|
PUBLIC_URL: ${{ vars.PUBLIC_URL || 'https://gitea.encke-hake.ts.net' }}
|
|
# The repository (owner/name on this Gitea) that receives the release: this one, or RELEASES_REPO together with the
|
|
# RELEASES_TOKEN secret (an access token with write access to it). Every build embeds its address as
|
|
# ChronosReleasesUrl, so the update check, licence and issue links read the repository published to.
|
|
RELEASES_REPO: ${{ vars.RELEASES_REPO || github.repository }}
|
|
|
|
jobs:
|
|
release:
|
|
name: Build, test and publish
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: mcr.microsoft.com/dotnet/sdk:10.0
|
|
timeout-minutes: 150
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
env:
|
|
# Secrets cannot appear in step conditions: expose only whether signing is configured.
|
|
HAS_SIGNING: ${{ secrets.SIGN_PFX_BASE64 != '' }}
|
|
outputs:
|
|
version: ${{ steps.version.outputs.version }}
|
|
latest: ${{ steps.publish.outputs.latest }}
|
|
steps:
|
|
- name: Version
|
|
id: version
|
|
run: |
|
|
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then
|
|
echo "::error title=Release::Tag '$TAG' is not vMAJOR.MINOR.PATCH or vMAJOR.MINOR.PATCH-PRERELEASE"
|
|
exit 1
|
|
fi
|
|
version="${TAG#v}"
|
|
prerelease=false
|
|
if [[ "$version" == *-* ]]; then prerelease=true; fi
|
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
{ echo "VERSION=$version"; echo "PRERELEASE=$prerelease"; } >> "$GITHUB_ENV"
|
|
|
|
# Full history and tags: the release notes list the commits since the previous tag.
|
|
- name: Checkout
|
|
env:
|
|
TOKEN: ${{ github.token }}
|
|
run: |
|
|
git config --global --add safe.directory "$PWD"
|
|
git init -q .
|
|
git remote add origin "${{ github.server_url }}/${{ github.repository }}.git"
|
|
git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --tags origin
|
|
git checkout -q "refs/tags/$TAG"
|
|
git log -1 --format='%h %s'
|
|
|
|
# Chronos.Data binds the system SQLite library (BRIEF §6.2), which the SDK image lacks.
|
|
- name: System SQLite
|
|
run: apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends libsqlite3-0 > /dev/null
|
|
|
|
- name: Release target
|
|
env:
|
|
HAS_RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN != '' }}
|
|
run: |
|
|
target="$RELEASES_REPO"
|
|
if [ "$target" != "${{ github.repository }}" ] && [ "$HAS_RELEASES_TOKEN" != "true" ]; then
|
|
echo "::warning title=Release::RELEASES_TOKEN is not set: publishing to ${{ github.repository }} instead of $target."
|
|
target="${{ github.repository }}"
|
|
fi
|
|
{ echo "TARGET=$target"; echo "CHRONOS_RELEASES_URL=${PUBLIC_URL%/}/$target"; } >> "$GITHUB_ENV"
|
|
echo "Release $TAG of $target; programs link ${PUBLIC_URL%/}/$target"
|
|
|
|
- name: Build and test
|
|
run: |
|
|
dotnet build Chronos.slnx -c Release -m:"$BUILD_CPUS" -p:ChronosVersion="$VERSION" -p:ChronosReleasesUrl="$CHRONOS_RELEASES_URL"
|
|
dotnet "$TOOLS" package-guard
|
|
dotnet "$TOOLS" i18n check
|
|
for t in Core Data Server Tools; do
|
|
dotnet run --project "tests/Chronos.$t.Tests" -c Release --no-build -- --junit "out/junit/$t.xml"
|
|
done
|
|
|
|
# Cross-compiled on Linux (EnableWindowsTargeting); pe-check stops the release if a program lost its icon,
|
|
# version information or DPI-aware manifest.
|
|
- name: Publish self-contained programs (win-x64)
|
|
run: |
|
|
common="-c Release -r win-x64 --self-contained -p:ChronosVersion=$VERSION -p:ChronosReleasesUrl=$CHRONOS_RELEASES_URL -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none -m:$BUILD_CPUS"
|
|
dotnet publish src/Chronos.App/Chronos.App.csproj $common -p:PublishReadyToRun=true -o out/publish/app
|
|
dotnet publish src/Chronos.Uploader/Chronos.Uploader.csproj $common -p:PublishReadyToRun=true -o out/publish/uploader
|
|
dotnet publish src/Chronos.Server/Chronos.Server.csproj $common -o out/publish/server
|
|
dotnet publish src/Chronos.Setup/Chronos.Setup.csproj $common -p:PublishReadyToRun=true -o out/publish/setup
|
|
dotnet "$TOOLS" pe-check out/publish/app/Chronos.exe out/publish/uploader/Chronos.Uploader.exe out/publish/setup/Chronos.Setup.exe
|
|
|
|
# Authenticode with osslsigncode, the Linux counterpart of signtool (BRIEF §18); unsigned builds are still released.
|
|
- name: Sign programs
|
|
if: env.HAS_SIGNING == 'true'
|
|
env:
|
|
SIGN_PFX: ${{ secrets.SIGN_PFX_BASE64 }}
|
|
SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }}
|
|
run: |
|
|
apt-get update -qq && apt-get install -y -qq osslsigncode > /dev/null
|
|
pfx="$RUNNER_TEMP/sign.pfx"
|
|
trap 'rm -f "$pfx"' EXIT
|
|
printf '%s' "$SIGN_PFX" | base64 -d > "$pfx"
|
|
for exe in out/publish/*/*.exe; do
|
|
osslsigncode sign -pkcs12 "$pfx" -pass "$SIGN_PASSWORD" -h sha256 -ts http://timestamp.digicert.com -in "$exe" -out "$exe.signed"
|
|
mv "$exe.signed" "$exe"
|
|
done
|
|
|
|
- name: Package installers and archives
|
|
run: |
|
|
mkdir -p out/release
|
|
dotnet "$TOOLS" pack-installer --setup out/publish/setup/Chronos.Setup.exe --product Chronos \
|
|
--component "Chronos=out/publish/app" --component "Uploader=out/publish/uploader" --component "Server=out/publish/server" \
|
|
--version "$VERSION" --out "out/release/Chronos-Setup-$VERSION.exe"
|
|
dotnet "$TOOLS" pack-installer --setup out/publish/setup/Chronos.Setup.exe --product "Chronos Uploader" \
|
|
--component "Uploader=out/publish/uploader" --version "$VERSION" --out "out/release/Chronos-Uploader-Setup-$VERSION.exe"
|
|
dotnet "$TOOLS" zip out/publish/server --out "out/release/Chronos-Server-win-x64-$VERSION.zip"
|
|
# The portable build keeps its data next to Chronos.exe because of portable.txt (never inside the installer).
|
|
cp -R out/publish/app out/portable
|
|
printf 'Chronos portable mode: settings, index and logs are kept in the data folder next to Chronos.exe.\r\n' > out/portable/portable.txt
|
|
dotnet "$TOOLS" zip out/portable --out "out/release/Chronos-win-x64-portable-$VERSION.zip"
|
|
dotnet "$TOOLS" pe-check out/release/*.exe
|
|
ls -l out/release
|
|
|
|
- name: Sign installers
|
|
if: env.HAS_SIGNING == 'true'
|
|
env:
|
|
SIGN_PFX: ${{ secrets.SIGN_PFX_BASE64 }}
|
|
SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }}
|
|
run: |
|
|
pfx="$RUNNER_TEMP/sign.pfx"
|
|
trap 'rm -f "$pfx"' EXIT
|
|
printf '%s' "$SIGN_PFX" | base64 -d > "$pfx"
|
|
for exe in out/release/*.exe; do
|
|
osslsigncode sign -pkcs12 "$pfx" -pass "$SIGN_PASSWORD" -h sha256 -ts http://timestamp.digicert.com -in "$exe" -out "$exe.signed"
|
|
mv "$exe.signed" "$exe"
|
|
done
|
|
|
|
- name: Unsigned build notice
|
|
if: env.HAS_SIGNING != 'true'
|
|
run: echo "::notice title=Signing::SIGN_PFX_BASE64 is not set; the installers are unsigned."
|
|
|
|
- name: Release notes
|
|
run: |
|
|
# 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"
|
|
git log --no-merges --format='%h%x09%s' "$range" | dotnet "$TOOLS" changelog --title "Chronos $VERSION" --out out/release-notes.md
|
|
cat out/release-notes.md
|
|
|
|
- name: Checksums
|
|
working-directory: out/release
|
|
run: |
|
|
rm -f SHA256SUMS
|
|
sha256sum -- * > "$RUNNER_TEMP/SHA256SUMS"
|
|
mv "$RUNNER_TEMP/SHA256SUMS" SHA256SUMS
|
|
cat SHA256SUMS
|
|
|
|
# Created as a draft, published once every file is uploaded and listed at its size (gitea-release).
|
|
- name: Gitea release
|
|
id: publish
|
|
env:
|
|
AUTO_TOKEN: ${{ github.token }}
|
|
RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN }}
|
|
run: |
|
|
token="$AUTO_TOKEN"
|
|
if [ "$TARGET" != "${{ github.repository }}" ]; then token="$RELEASES_TOKEN"; fi
|
|
GITEA_TOKEN="$token" dotnet "$TOOLS" gitea-release --server "${{ github.server_url }}" --repo "$TARGET" --tag "$TAG" \
|
|
--title "Chronos $VERSION" --notes-file out/release-notes.md --assets out/release --prerelease "$PRERELEASE"
|
|
# The public content and the image's :latest follow the highest stable version (not Gitea's "latest", which
|
|
# is the most recently created one): re-publishing an older tag or publishing a pre-release never rolls them back.
|
|
stable="$(curl -fsS -H "Authorization: token $token" "${{ github.server_url }}/api/v1/repos/$TARGET/releases?draft=false&pre-release=false&limit=50")"
|
|
newest="$(printf '%s' "$stable" | grep -o '"tag_name":"v[^"]*"' | cut -d '"' -f 4 | sed 's/^v//' | sort -V | tail -n 1 || true)"
|
|
newest="${newest:+v$newest}"
|
|
latest=false
|
|
if [ "$PRERELEASE" = "false" ] && [ "$newest" = "$TAG" ]; then latest=true; fi
|
|
echo "Newest stable release of $TARGET: ${newest:-none}; $TAG moves the public content and :latest: $latest"
|
|
echo "latest=$latest" >> "$GITHUB_OUTPUT"
|
|
echo "LATEST=$latest" >> "$GITHUB_ENV"
|
|
|
|
# Only with a separate releases repository (RELEASES_REPO and RELEASES_TOKEN, BRIEF §19.4): its README, EULA,
|
|
# security policy, issue forms, Unraid template, compose file, i18n/ and SHA256SUMS follow the newest stable
|
|
# release, with links to that repository and image.
|
|
- name: Update the public releases repository
|
|
if: env.LATEST == 'true' && env.TARGET != github.repository
|
|
env:
|
|
TOKEN: ${{ secrets.RELEASES_TOKEN }}
|
|
run: |
|
|
server="${{ github.server_url }}"
|
|
branch="$(curl -fsS -H "Authorization: token $TOKEN" "$server/api/v1/repos/$TARGET" | grep -o '"default_branch":"[^"]*"' | head -n 1 | cut -d '"' -f 4)"
|
|
git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" clone -q --depth 1 "$server/$TARGET.git" public
|
|
git -C public checkout -q -B "$branch"
|
|
cp -R deploy/releases-repo/. public/
|
|
cp EULA.md SECURITY.md public/
|
|
mkdir -p public/.gitea
|
|
rm -rf public/.gitea/ISSUE_TEMPLATE
|
|
cp -R .gitea/ISSUE_TEMPLATE public/.gitea/ISSUE_TEMPLATE
|
|
mkdir -p public/unraid public/docker
|
|
cp deploy/unraid/chronos.xml public/unraid/chronos.xml
|
|
# Unraid keeps a template's icon as a PNG: the 256 px one the build generated (make-icon), not the SVG source.
|
|
cp artifacts/icons/chronos-server-256.png public/unraid/chronos-server.png
|
|
# The screenshots of the public README are the approved baselines, once committed (tests/visual/baselines).
|
|
mkdir -p public/screenshots
|
|
for shot in library jobs settings-rendering server uploader-queue; do
|
|
if [ -f "tests/visual/baselines/$shot-dark.png" ]; then cp "tests/visual/baselines/$shot-dark.png" public/screenshots/; fi
|
|
done
|
|
cp deploy/docker/docker-compose.yml deploy/docker/.env.example public/docker/
|
|
rm -rf public/i18n
|
|
cp -R i18n public/i18n
|
|
cp out/release/SHA256SUMS public/SHA256SUMS
|
|
registry="${{ vars.REGISTRY }}"
|
|
registry="${registry:-$(printf '%s' "$PUBLIC_URL" | sed -E 's#^[a-z]+://##; s#/.*$##')}"
|
|
owner="$(printf '%s' "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
|
|
public="${PUBLIC_URL%/}"
|
|
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#https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/deploy/unraid/#$public/$TARGET/raw/branch/$branch/unraid/#g" \
|
|
-e "s#https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/branding/chronos-server.svg#$public/$TARGET/raw/branch/$branch/unraid/chronos-server.png#g" \
|
|
-e "s#https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/deploy/docker/#$public/$TARGET/raw/branch/$branch/docker/#g" \
|
|
-e "s#https://gitea.encke-hake.ts.net/BalboSoft/Chronos\([^-A-Za-z0-9_.]\|\$\)#$public/$TARGET\1#g" \
|
|
-e "s#gitea.encke-hake.ts.net/balbosoft/chronos-server#$registry/$owner/chronos-server#g" -e "s#docker login gitea.encke-hake.ts.net#docker login $registry#g"
|
|
cd public
|
|
git config user.name "chronos-release"
|
|
git config user.email "chronos-release@noreply.invalid"
|
|
git add -A
|
|
if git diff --cached --quiet; then
|
|
echo "Public repository already up to date."
|
|
else
|
|
git commit -q -m "chore: update for $TAG"
|
|
git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" push -q origin "HEAD:$branch"
|
|
fi
|
|
|
|
# The server image (BRIEF §19.3) goes to the Gitea container registry of the repository owner once the release job's
|
|
# tests passed. The runner's own image has the docker CLI and builds with the host's daemon (linux/amd64; arm64 would
|
|
# need QEMU emulation installed on the host). REGISTRY, REGISTRY_USER and the REGISTRY_TOKEN secret override the
|
|
# registry (default: the host of PUBLIC_URL), the user and the token (default: the workflow's own).
|
|
image:
|
|
name: Server image
|
|
needs: release
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
env:
|
|
VERSION: ${{ needs.release.outputs.version }}
|
|
LATEST: ${{ needs.release.outputs.latest }}
|
|
steps:
|
|
- name: Checkout
|
|
env:
|
|
TOKEN: ${{ github.token }}
|
|
run: |
|
|
git config --global --add safe.directory "$PWD"
|
|
git init -q .
|
|
git remote add origin "${{ github.server_url }}/${{ github.repository }}.git"
|
|
git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "refs/tags/$TAG:refs/tags/$TAG"
|
|
git checkout -q "refs/tags/$TAG"
|
|
|
|
- name: Sign in to the registry
|
|
env:
|
|
REGISTRY: ${{ vars.REGISTRY }}
|
|
USER: ${{ vars.REGISTRY_USER || github.actor }}
|
|
TOKEN: ${{ secrets.REGISTRY_TOKEN || github.token }}
|
|
run: |
|
|
registry="${REGISTRY:-$(printf '%s' "$PUBLIC_URL" | sed -E 's#^[a-z]+://##; s#/.*$##')}"
|
|
owner="$(printf '%s' "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
|
|
{ echo "REGISTRY_HOST=$registry"; echo "IMAGE=$registry/$owner/chronos-server"; } >> "$GITHUB_ENV"
|
|
if ! printf '%s' "$TOKEN" | docker login "$registry" -u "$USER" --password-stdin; then
|
|
# The workflow's own token (user gitea-actions) has no package permission on an organisation's registry.
|
|
echo "::error title=Registry::Sign-in to $registry refused. Add the repository secret REGISTRY_TOKEN: an access token of a user who can write the owner's packages (scope package: read and write)."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Build and push
|
|
run: |
|
|
docker build -f deploy/docker/Dockerfile --build-arg CHRONOS_VERSION="$VERSION" -t "$IMAGE:$VERSION" .
|
|
docker push "$IMAGE:$VERSION"
|
|
# Compose and Unraid users follow :latest: it moves only to the newest stable release.
|
|
if [ "$LATEST" = "true" ]; then
|
|
docker tag "$IMAGE:$VERSION" "$IMAGE:latest"
|
|
docker push "$IMAGE:latest"
|
|
fi
|
|
echo "Image: $IMAGE:$VERSION$([ "$LATEST" = "true" ] && echo " and :latest")"
|
|
|
|
- name: Clean up
|
|
if: always()
|
|
run: |
|
|
docker image rm "$IMAGE:$VERSION" "$IMAGE:latest" 2> /dev/null || true
|
|
docker logout "$REGISTRY_HOST" || true
|