From 1a877dcd527d7a4ff498a3a59daa76ad2cec8019 Mon Sep 17 00:00:00 2001 From: Timothy Date: Sat, 27 Jun 2026 01:28:02 +0200 Subject: [PATCH] ci: add self-hosted Renovate (NuGet CPM + Gitea Actions) Stand up Renovate for this repo via a scheduled Gitea Actions workflow on the shared act_runner. Managers: nuget (Central Package Management) + github-actions. Dockerfile/docker-compose managers deferred until the HTTP Gitea-registry handling is verified. - renovate.json: config:recommended, dependency dashboard, OSV vulnerability alerts, family grouping (Microsoft.Extensions/AspNetCore/EF Core/Serilog/ Refit/Lucene.Net), and patch-level auto-merge scoped to test/dev-only packages (NUnit/NSubstitute/Shouldly/coverlet/Test.Sdk/Testably/threading analyzer). - .gitea/workflows/renovate.yml: weekly cron + workflow_dispatch (defaults to a safe dry run); bot identity + tokens from repo Actions secrets. Supersedes the *proposing* half that dependency-scan.yml (ersatztv#14) left out; the scan stays as a cheap in-repo detector for now. refs server-management#484 Co-Authored-By: Claude Opus 4.8 (1M context) --- .gitea/workflows/renovate.yml | 65 ++++++++++++++++++++++++++++++++ renovate.json | 70 +++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 .gitea/workflows/renovate.yml create mode 100644 renovate.json diff --git a/.gitea/workflows/renovate.yml b/.gitea/workflows/renovate.yml new file mode 100644 index 000000000..eb7fd8bdd --- /dev/null +++ b/.gitea/workflows/renovate.yml @@ -0,0 +1,65 @@ +name: Renovate + +# Self-hosted Renovate for the ErsatzTV fork (server-management#484). +# +# Opens dependency-update PRs against this repo (managers: nuget via CPM, github-actions). +# Runs on the shared Gitea act_runner (bumblebee). It supersedes the *proposing* half that +# the dependency-scan.yml (ersatztv#14) deliberately left out — that scan stays as a cheap +# in-repo detector for now. +# +# Config: repo-root renovate.json (package rules, grouping, automerge policy). +# Bot identity + tokens are injected from repo Actions secrets: +# RENOVATE_TOKEN — PAT of the dedicated `renovate` Gitea bot (write:repository, +# read:user, write:issue, read:organization) +# GITHUB_COM_TOKEN — no-scope github.com PAT for changelog/release-note fetching +# (Renovate needs this on non-GitHub platforms; optional, degrades +# gracefully to anonymous if unset) +# +# NOTE: Gitea runs `schedule` triggers ONLY from the default branch (main); this file must +# be on main before the cron registers. Use workflow_dispatch to run on demand — it defaults +# to a DRY RUN (logs only, no PRs); dispatch with "Dry run" cleared to create real PRs. + +on: + workflow_dispatch: + inputs: + dryRun: + description: 'Dry run (full = log only, no PRs; clear for a live run)' + type: choice + options: + - 'full' + - '' + default: 'full' + logLevel: + description: 'Log level' + type: choice + options: + - 'info' + - 'debug' + default: 'info' + schedule: + # Mondays 03:00 UTC — ahead of the 06:00 vulnerability scan + - cron: '0 3 * * 1' + +concurrency: + group: ersatztv-renovate + cancel-in-progress: false + +jobs: + renovate: + name: Renovate + runs-on: ubuntu-latest + container: + image: renovate/renovate:41 + steps: + - name: Run Renovate + env: + RENOVATE_PLATFORM: gitea + RENOVATE_ENDPOINT: http://192.168.1.95:3000/api/v1 + RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }} + RENOVATE_GITHUB_COM_TOKEN: ${{ secrets.GITHUB_COM_TOKEN }} + RENOVATE_REPOSITORIES: timothy/ersatztv + RENOVATE_AUTODISCOVER: 'false' + RENOVATE_GIT_AUTHOR: 'Renovate Bot ' + RENOVATE_DRY_RUN: ${{ inputs.dryRun }} + LOG_LEVEL: ${{ inputs.logLevel || 'info' }} + run: renovate diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..dd84b16f8 --- /dev/null +++ b/renovate.json @@ -0,0 +1,70 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ], + "timezone": "Europe/Brussels", + "semanticCommits": "enabled", + "dependencyDashboard": true, + "labels": ["dependencies"], + "enabledManagers": ["nuget", "github-actions"], + "osvVulnerabilityAlerts": true, + "vulnerabilityAlerts": { + "labels": ["dependencies", "security"] + }, + "prConcurrentLimit": 5, + "packageRules": [ + { + "description": "Group the Microsoft.Extensions.* family into one PR", + "matchPackageNames": ["/^Microsoft\\.Extensions\\./"], + "groupName": "Microsoft.Extensions" + }, + { + "description": "Group the Microsoft.AspNetCore.* family into one PR", + "matchPackageNames": ["/^Microsoft\\.AspNetCore\\./"], + "groupName": "Microsoft.AspNetCore" + }, + { + "description": "Group Entity Framework Core + providers (held to v9 by the range pins in Directory.Packages.props)", + "matchPackageNames": [ + "/^Microsoft\\.EntityFrameworkCore/", + "/^EFCore\\.BulkExtensions/", + "/^Pomelo\\.EntityFrameworkCore/" + ], + "groupName": "Entity Framework Core" + }, + { + "description": "Group the Serilog family into one PR", + "matchPackageNames": ["/^Serilog/"], + "groupName": "Serilog" + }, + { + "description": "Group the Refit family into one PR", + "matchPackageNames": ["/^Refit/"], + "groupName": "Refit" + }, + { + "description": "Group the Lucene.Net family into one PR", + "matchPackageNames": ["/^Lucene\\.Net/"], + "groupName": "Lucene.Net" + }, + { + "description": "Auto-merge patch bumps to test/dev-only packages once the build+test check passes; everything else stays manual (ersatztv is prod-bearing). server-management#484", + "matchPackageNames": [ + "NUnit", + "NUnit.Analyzers", + "NUnit3TestAdapter", + "NSubstitute", + "Shouldly", + "coverlet.collector", + "Microsoft.NET.Test.Sdk", + "Testably.Abstractions", + "Testably.Abstractions.Testing", + "Microsoft.VisualStudio.Threading.Analyzers" + ], + "matchUpdateTypes": ["patch"], + "automerge": true, + "platformAutomerge": true + } + ] +}