Files
Plugin_Test_Action/.gitea/workflows/release.yaml
Michael Otto be3811785b
Some checks failed
Release Plugin / release (push) Failing after 2s
gitea actions ng6
2026-03-17 10:03:13 +01:00

73 lines
1.9 KiB
YAML

name: Release Plugin
run-name: "Release | ${{ github.ref_name }}"
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: alpine-latest
defaults:
run:
shell: bash
steps:
- name: Notwendige Abhängigkeiten installieren
shell: sh
run: |
apk add --no-cache bash git
- name: Version und Kanal bestimmen
id: releaseinfo
run: |
TAG="${{ github.ref_name }}"
RAW_VERSION="${TAG#v}"
BASE_VERSION="${RAW_VERSION%%-*}"
# Volles Repo auschecken, damit wir Branch-Info haben
git fetch --all --tags
# Branch ermitteln, auf dem der Tag liegt
BRANCH=$(git branch -r --contains "$TAG" | grep -v 'HEAD' | head -n1 | sed 's|origin/||')
echo "Branch des Tags: $BRANCH"
# Channel und Suffix automatisch bestimmen
case "$BRANCH" in
main)
CHANNEL="stable"
PRERELEASE="false"
SUFFIX=""
;;
testing)
CHANNEL="testing"
PRERELEASE="true"
SUFFIX="-testing"
;;
unstable)
CHANNEL="unstable"
PRERELEASE="true"
SUFFIX="-unstable"
;;
*)
# unbekannter Branch -> default unstable
CHANNEL="unstable"
PRERELEASE="true"
SUFFIX="-unstable"
;;
esac
# Version zusammensetzen
VERSION="${BASE_VERSION}${SUFFIX}"
# Output setzen
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "channel=$CHANNEL" >> $GITHUB_OUTPUT
echo "prerelease=$PRERELEASE" >> $GITHUB_OUTPUT
# Debug
echo "Tag: $TAG"
echo "Version: $VERSION"
echo "Channel: $CHANNEL"
echo "Prerelease: $PRERELEASE"