feat(ci): add automated workflows for releases and Docker builds

- Introduce auto-changelog and release workflow for version management
- Add Docker workflows for nightly and release image builds
- Include scripts for release ID retrieval and asset uploads
- Document release process and best practices in `.gitea` directory
This commit is contained in:
2025-05-11 01:10:10 +02:00
parent b473b7cce1
commit b6e0947c3c
7 changed files with 668 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
# ========================
# 📦 Upload Assets Template
# ========================
# Dieser Workflow wird automatisch ausgelöst, wenn ein Release
# in Gitea veröffentlicht wurde (event: release.published).
#
# Er dient dem Zweck, Release-Artefakte (wie z. B. Binary-Dateien,
# Changelogs oder Build-Zips) nachträglich mit dem Release zu verknüpfen.
#
# Voraussetzung: Zwei Shell-Skripte liegen im Projekt:
# - .gitea/scripts/get-release-id.sh → ermittelt Release-ID per Tag
# - .gitea/scripts/upload-asset.sh → lädt Datei als Release-Asset hoch
#
# --------------------------------------
name: Build and upload Docker release image
on:
release:
types: [published] # Nur bei Veröffentlichung eines Releases (nicht bei Entwürfen)
jobs:
upload-assets:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.release.tag_name }}
steps:
# 📥 Checke den Stand des Repos aus, exakt auf dem veröffentlichten Tag
# So ist garantiert, dass die Artefakte dem Zustand des Releases entsprechen.
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }} # z. B. "v1.2.3"
- name: Strip "v" from tag
id: version
run: |
echo "VERSION_STRIPPED=${VERSION#v}" >> $GITHUB_OUTPUT
- name: Restore Docker cache
uses: https://git.0xmax42.io/actions/cache@v1
with:
key: buildx-general
paths: |
/tmp/.buildx-cache
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
install: true
- name: Login to Gitea Docker Registry
env:
REGISTRY: git.0xmax42.io
USERNAME: ${{ secrets.PACKAGE_USER }}
PASSWORD: ${{ secrets.PACKAGE_TOKEN }}
run: |
echo "$PASSWORD" | docker login $REGISTRY --username "$USERNAME" --password-stdin
- name: Build Docker Image
run: |
docker buildx build \
--tag git.0xmax42.io/simdev/lt-auth-proxy:${{ steps.version.outputs.VERSION_STRIPPED }} \
--tag git.0xmax42.io/simdev/lt-auth-proxy:latest \
--label org.opencontainers.image.description="Lightweight LanguageTool Auth Proxy" \
--label org.opencontainers.image.documentation="https://git.0xmax42.io/maxp/lt-auth-proxy" \
--label org.opencontainers.image.authors="0xMax42 <mail@0xmax42.io>" \
--label org.opencontainers.image.version=${VERSION} \
--platform linux/amd64,linux/arm64 \
--cache-from=type=local,src=/tmp/.buildx-cache \
--cache-to=type=local,dest=/tmp/.buildx-cache,mode=max \
--builder ${{ steps.buildx.outputs.name }} \
--push \
--progress=plain \
.