cahnges to the release process
Release Inventarsystem / release-docker (push) Successful in 2m28s

This commit is contained in:
2026-08-05 20:24:05 +02:00
parent 80262aca9b
commit 35b87a9a98
2 changed files with 104 additions and 16 deletions
+32 -9
View File
@@ -5,18 +5,19 @@ on:
tags:
- "v*"
branches:
- develop
- main
workflow_dispatch:
inputs:
bump:
description: "Version bump type (major stays fixed from latest release)"
release_type:
description: "Release type"
required: false
default: "patch"
type: choice
options:
- patch
- minor
- major
- minor
- patch
- dev
permissions:
contents: write
@@ -40,11 +41,33 @@ jobs:
REPO: ${{ gitea.repository }}
EVENT_NAME: ${{ gitea.event_name }}
REF_NAME: ${{ gitea.ref_name }}
BUMP_TYPE: ${{ gitea.event.inputs.bump || 'patch' }}
RELEASE_TYPE: ${{ gitea.event.inputs.release_type || 'patch' }}
RUN_NUMBER: ${{ gitea.run_number }}
DOCKER_API_VERSION: '1.44'
run: |
if [ "$EVENT_NAME" = "push" ] && [ "$REF_NAME" = "develop" ]; then
if [ "$EVENT_NAME" = "push" ] && [ "$REF_NAME" = "main" ]; then
prerelease=true
latest_tag="v0.8.31"
if meta_json=$(curl -fsSL -H "Authorization: Bearer $GH_TOKEN" -H "Accept: application/json" "https://git.invario-software.eu/api/v1/repos/$REPO/releases/latest" 2>/dev/null); then
tag_name=$(printf "%s" "$meta_json" | sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -n1)
if [ -n "$tag_name" ]; then
latest_tag="$tag_name"
fi
fi
if [[ "$latest_tag" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
major=${BASH_REMATCH[1]}
minor=${BASH_REMATCH[2]}
patch=${BASH_REMATCH[3]}
else
major=0
minor=8
patch=31
fi
patch=$((patch + 1))
TAG="v${major}.${minor}.${patch}-dev.${RUN_NUMBER:-0}"
elif [ "$EVENT_NAME" = "workflow_dispatch" ] && [ "$RELEASE_TYPE" = "dev" ]; then
prerelease=true
latest_tag="v0.8.31"
if meta_json=$(curl -fsSL -H "Authorization: Bearer $GH_TOKEN" -H "Accept: application/json" "https://git.invario-software.eu/api/v1/repos/$REPO/releases/latest" 2>/dev/null); then
@@ -87,9 +110,9 @@ jobs:
major=0; minor=8; patch=31
fi
if [ "${BUMP_TYPE:-}" = "major" ]; then
if [ "${RELEASE_TYPE:-}" = "major" ]; then
major=$((major + 1)); minor=0; patch=0
elif [ "${BUMP_TYPE:-}" = "minor" ]; then
elif [ "${RELEASE_TYPE:-}" = "minor" ]; then
minor=$((minor + 1)); patch=0
else
patch=$((patch + 1))