All checks were successful
Release / Build release images and notes (push) Successful in 1m8s
CD / Build and push images (push) Successful in 1m9s
CD / Deploy to Test (push) Successful in 9s
Release / Release-candidate operations QA (push) Successful in 41s
CD / Smoke tests against Test (push) Successful in 1m10s
CD / Promote to Int (push) Successful in 10s
Prod deploy / Deploy the released images to Prod (push) Successful in 15s
CI / Lint, typecheck, test (push) Successful in 3m35s
CI / Build container images (push) Has been skipped
CI / Auth e2e pack (push) Successful in 5m32s
CI / Import/export fidelity gate (push) Successful in 48s
New deploy/release-qa.sh, wired as the release workflow's second job: it boots the PREVIOUS release with pre-seeded fixture content in a scratch environment, swaps the api to the candidate against the same database (migrations auto-apply, readiness green, content intact — the seed_fixture/assert_fixture pair is the update-fixture contract future migrations extend), asserts the degraded-readyz semantics on the candidate (200 + warn-level checks without sidecars), and runs a full backup/restore roundtrip with the candidate's sidecar into a second, empty database. The wizard e2e already guards fresh installs in CI (issue #81). Verified green on the host for v0.1.0→v0.1.1; a simulated destructive migration made the suite fail loudly (negative test, not committed). A human pushes the prod tag only when both release jobs are green — the documented pre-approval gate. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EwZ4jR4KFAPvpjWevfUGX1
88 lines
3.6 KiB
YAML
88 lines
3.6 KiB
YAML
# Release build (ADR 0014, issue #89): pushing a semver tag `vX.Y.Z` builds
|
|
# and pushes the immutable release images and publishes a Gitea release
|
|
# whose notes list the changes since the previous release, with a call-out
|
|
# when the release contains database migrations (the `migration` marker the
|
|
# update guide promises). Deploying to Prod is a SEPARATE, manual step:
|
|
# after reviewing the release, push a `prod-vX.Y.Z-<suffix>` tag
|
|
# (prod-deploy.yml) — that tag push is the manual approval gate, since
|
|
# Gitea 1.22 has no environment approvals (revisit on 1.23+).
|
|
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*.*.*']
|
|
|
|
env:
|
|
IMAGE_BASE: gitea.101010.cloud/stwaidele/dorfteich
|
|
|
|
jobs:
|
|
build-release:
|
|
name: Build release images and notes
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Log in to the Gitea registry
|
|
run: printf '%s' "${{ secrets.REGISTRY_TOKEN }}" | tr -d '[:space:]' | docker login gitea.101010.cloud -u fable-5 --password-stdin
|
|
|
|
- name: Build and push semver images
|
|
run: |
|
|
TAG=${GITHUB_REF_NAME}
|
|
for app in web api collab backup; do
|
|
docker build -f apps/$app/Dockerfile --build-arg APP_VERSION=$TAG \
|
|
-t $IMAGE_BASE-$app:$TAG .
|
|
docker push $IMAGE_BASE-$app:$TAG
|
|
done
|
|
|
|
- name: Generate release notes and publish the release
|
|
run: |
|
|
TAG=${GITHUB_REF_NAME}
|
|
PREV=$(git tag --list 'v*.*.*' --sort=-v:refname | grep -vx "$TAG" | head -n1 || true)
|
|
RANGE=${PREV:+$PREV..}$TAG
|
|
{
|
|
echo "## Changes since ${PREV:-the beginning}"
|
|
echo
|
|
git log --no-merges --pretty='- %s' $RANGE
|
|
echo
|
|
if git diff --name-only ${PREV:-$(git hash-object -t tree /dev/null)} $TAG -- apps/api/prisma/migrations/ | grep -q .; then
|
|
echo '> ⚠️ **migration** — this release applies database migrations automatically at api start. Downgrade window: one minor release (docs/self-hosting).'
|
|
else
|
|
echo '_No database migrations in this release._'
|
|
fi
|
|
} > notes.md
|
|
TAG=$TAG docker run --rm -i -e TAG node:22.15-alpine node -e \
|
|
'const fs=require("fs");const body=fs.readFileSync(0,"utf8");process.stdout.write(JSON.stringify({tag_name:process.env.TAG,name:process.env.TAG,body}))' \
|
|
< notes.md > release.json
|
|
curl -sf -X POST \
|
|
-H "Authorization: token ${{ github.token }}" \
|
|
-H 'Content-Type: application/json' \
|
|
--data @release.json \
|
|
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases" \
|
|
> /dev/null && echo "release $TAG published"
|
|
|
|
# Operations QA (issue #90): the pre-approval gate. A human pushes the
|
|
# prod-vX.Y.Z tag only after BOTH jobs of this release run are green.
|
|
ops-qa:
|
|
name: Release-candidate operations QA
|
|
needs: build-release
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Log in to the Gitea registry
|
|
run: printf '%s' "${{ secrets.REGISTRY_TOKEN }}" | tr -d '[:space:]' | docker login gitea.101010.cloud -u fable-5 --password-stdin
|
|
|
|
- name: Run update simulation, degraded readiness, and backup roundtrip
|
|
run: |
|
|
PREV=$(git tag --list 'v*.*.*' --sort=-v:refname | grep -vx "$GITHUB_REF_NAME" | head -n1 || true)
|
|
NEXT_TAG=$GITHUB_REF_NAME PREV_TAG=$PREV IMAGE_BASE=$IMAGE_BASE \
|
|
sh deploy/release-qa.sh
|