M7: release polish — export/import, docs, easy docker push

- Easy docker push (MQTTower ergonomics + the image push it lacks): VERSION file →
  version-tag.yml (semver-guard auto-tag) → docker-publish.yml (buildx multi-arch → GHCR,
  registry centralized for one-line retarget to git.finalfactory.de) + ci.yml + build-and-push.ps1.
- Verified end to end: deploy/Dockerfile builds; docker compose stack (app + timescaledb) comes
  up healthy; /healthz and the dashboard respond in-container.
- JSON config export/import (ExportService) with id remapping on restore + GET /export, POST
  /import endpoints; round-trip test preserves meter→type, meter-scoped tariff, category links.
- README, HA/Tasmota/MQTT wiring guide (docs/wiring.md), Unraid template.
- CLAUDE.md updated to reflect the built codebase.
- i18n: locale-aware number/currency formatting (de-DE); full de UI string localization deferred.

95 tests green (56 Core + 39 integration).

Claude-Session: https://claude.ai/code/session_01WujdMtMJPbxDpDnMeK22rr
This commit is contained in:
2026-07-13 12:25:03 +02:00
parent 9abc2937c2
commit e223278771
14 changed files with 634 additions and 12 deletions
+28
View File
@@ -0,0 +1,28 @@
# Build + test on push/PR. Integration tests spin a TimescaleDB via Testcontainers, which needs
# a Docker daemon — available on the ubuntu-latest runner.
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
- name: Test
run: dotnet test --no-build -c Release --logger "trx;LogFileName=test-results.trx"
+50
View File
@@ -0,0 +1,50 @@
# Builds and pushes the multi-arch MeterVault image on a vX.Y.Z tag (SDD §11).
# Default registry is GHCR; change REGISTRY/IMAGE below (one place) to target the FinalFactory
# registry (e.g. REGISTRY: git.finalfactory.de) and set the matching login secrets.
name: docker-publish
on:
push:
tags: ["v*"]
workflow_dispatch: {}
env:
REGISTRY: ghcr.io
IMAGE: ${{ github.repository }} # ghcr.io/<owner>/metervault
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Derive version
id: ver
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Log in to the registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: deploy/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.ver.outputs.version }}
${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
+50
View File
@@ -0,0 +1,50 @@
# Turns an edit to the VERSION file on main into an annotated vX.Y.Z tag (the "easy release"
# ergonomics from MQTTower). The tag then triggers docker-publish.yml. A tag pushed with
# GITHUB_TOKEN would not trigger other workflows, so this job uses a PAT if provided
# (RELEASE_PAT), otherwise it still tags and you can trigger the image build manually.
name: version-tag
on:
push:
branches: [main]
paths:
- "VERSION"
permissions:
contents: write
concurrency:
group: version-tag
cancel-in-progress: true
jobs:
tag-if-newer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create tag if VERSION is the new highest semver
env:
GIT_AUTHOR_NAME: github-actions[bot]
GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
run: |
set -euo pipefail
RAW="$(tr -d ' \r\n' < VERSION)"
VERSION="${RAW#v}"
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "VERSION '$RAW' is not X.Y.Z"; exit 1
fi
TAG="v${VERSION}"
if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null; then
echo "Tag ${TAG} already exists; nothing to do."; exit 0
fi
HIGHEST="$(git tag -l 'v*' | sort -V | tail -n1 || true)"
if [ -n "$HIGHEST" ] && [ "$(printf '%s\n%s\n' "$HIGHEST" "$TAG" | sort -V | tail -n1)" != "$TAG" ]; then
echo "${TAG} is not greater than existing ${HIGHEST}; refusing."; exit 1
fi
git config user.name "$GIT_AUTHOR_NAME"
git config user.email "$GIT_AUTHOR_EMAIL"
git tag -a "$TAG" -m "Release $TAG"
git push origin "refs/tags/${TAG}"