Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permissions:

on:
push:
branches: [ master, main ]
branches: [ master, main, dev ] # ← Added "dev" here
workflow_dispatch:
inputs:
firstName:
Expand Down Expand Up @@ -45,14 +45,12 @@ jobs:
- name: Build shadowJar
run: ./gradlew shadowJar

# 1) JAR-Pfad bestimmen
- name: Find built JAR
id: jar
run: |
JAR_PATH=$(ls build/libs/*.jar | head -n1)
echo "jar_path=$JAR_PATH" >> $GITHUB_OUTPUT

# 2) Version aus plugin.yml im JAR extrahieren
- name: Extract version from JAR
id: vars
run: |
Expand All @@ -61,22 +59,19 @@ jobs:
| sed 's/version:[ ]*//')
echo "version=$VERSION" >> $GITHUB_OUTPUT

# 3) Alle Tags holen, um lokal prüfen zu können
- name: Fetch all tags
run: git fetch --tags

# 4) Abbrechen, wenn der Tag schon existiert
- name: Check if tag exists
run: |
TAG=${{ steps.vars.outputs.version }}
if git ls-remote --tags origin "refs/tags/$TAG" | grep -q "$TAG"; then
echo "❌ Tag '$TAG' existiert bereits. Breche ab."
echo "❌ Tag '$TAG' already exists. Exiting."
exit 1
else
echo "✅ Tag '$TAG' ist neu. Fortfahren..."
echo "✅ Tag '$TAG' is new. Continuing..."
fi

# 5) Release anlegen (Prerelease, wenn SNAPSHOT)
- name: Create Release
id: create
uses: actions/create-release@v1
Expand All @@ -86,10 +81,9 @@ jobs:
tag_name: ${{ steps.vars.outputs.version }}
release_name: ${{ steps.vars.outputs.version }}
draft: false
# Prerelease = true, wenn Version auf "-SNAPSHOT" endet
prerelease: ${{ endsWith( steps.vars.outputs.version, '-SNAPSHOT' ) }}
# Always prerelease if we're on dev, otherwise only for -SNAPSHOT
prerelease: ${{ (github.ref == 'refs/heads/dev') || (endsWith(steps.vars.outputs.version, '-SNAPSHOT')) }}

# 6) JAR hochladen
- name: Upload JAR
uses: actions/upload-release-asset@v1
env:
Expand Down
Loading