torsten-patch-1 #2

Merged
Torsten merged 4 commits from torsten-patch-1 into main 2026-04-11 20:41:51 +00:00
Showing only changes of commit 4e8536ec51 - Show all commits

View File

@@ -0,0 +1,66 @@
name: Tag from TOC Version
on:
push:
branches:
- main
jobs:
tag:
runs-on: debian-12
steps:
- name: Tools installieren
run: |
apt-get update
apt-get install -y git grep sed
- name: Repo klonen
run: |
rm -rf /tmp/repo
git clone http://oauth2:${{ secrets.PAT_TOKEN }}@10.10.2.140:3000/Torsten/HailMaryGuildTools.git /tmp/repo
- name: Version aus TOC lesen
run: |
set -e
cd /tmp/repo
TOC_FILE="HailMaryGuildTools.toc"
if [ ! -f "$TOC_FILE" ]; then
echo "TOC-Datei nicht gefunden: $TOC_FILE"
exit 1
fi
VERSION=$(grep '^## Version:' "$TOC_FILE" | sed 's/^## Version:[[:space:]]*//')
if [ -z "$VERSION" ]; then
echo "Keine Version in $TOC_FILE gefunden"
exit 1
fi
TAG="v$VERSION"
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
echo "TAG=$TAG" >> "$GITHUB_ENV"
echo "Gefundene Version: $VERSION"
echo "Neues Tag wäre: $TAG"
- name: Tag nur erstellen, wenn noch nicht vorhanden
run: |
set -e
cd /tmp/repo
git fetch --tags
if git rev-parse "${TAG}" >/dev/null 2>&1; then
echo "Tag ${TAG} existiert bereits, nichts zu tun."
exit 0
fi
git config user.name "Gitea Actions"
git config user.email "actions@local"
git tag "${TAG}"
git push origin "${TAG}"