Skip to content

Commit 5dc8816

Browse files
Merge pull request #10 from securebitsorg/feature/github-releases-documentation
fix: resolve auto-release workflow issues and sync versions
2 parents 233eca0 + 97279fd commit 5dc8816

5 files changed

Lines changed: 130 additions & 5 deletions

File tree

.github/workflows/auto-release-on-push.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,14 @@ jobs:
5555
RELEASE_TYPE=""
5656
NEW_VERSION=""
5757
58-
if [[ "$COMMIT_MSG" =~ ^(feat|feature)(\(.+\))?!: ]] || [[ "$COMMIT_MSG" =~ BREAKING[[:space:]]CHANGE ]]; then
58+
# Behandle Merge-Commits speziell
59+
if [[ "$COMMIT_MSG" =~ ^Merge[[:space:]]pull[[:space:]]request ]]; then
60+
echo "Merge commit detected, analyzing PR content..."
61+
# Für Merge-Commits: Minor release (neue Features zusammengeführt)
62+
SHOULD_RELEASE="true"
63+
RELEASE_TYPE="minor"
64+
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{print $1"."$2+1".0"}')
65+
elif [[ "$COMMIT_MSG" =~ ^(feat|feature)(\(.+\))?!: ]] || [[ "$COMMIT_MSG" =~ BREAKING[[:space:]]CHANGE ]]; then
5966
# Major release (breaking change)
6067
SHOULD_RELEASE="true"
6168
RELEASE_TYPE="major"

RELEASE_WORKFLOW_FIX.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# 🔧 Release Workflow Fix
2+
3+
## 🚨 Problem identifiziert
4+
5+
### Symptome:
6+
```
7+
Commit message: Merge pull request #9 from securebitsorg/feature/github-releases-documentation
8+
Current version: 1.9.1
9+
Last tag version: 0.0.0 ← Problem!
10+
Should release: false ← Problem!
11+
Release type:
12+
New version:
13+
```
14+
15+
### Root Cause:
16+
1. **Merge-Commits nicht erkannt** - Workflow erkennt nur Conventional Commits
17+
2. **Tag-Erkennung fehlerhaft** - `git describe --tags --abbrev=0` gibt "0.0.0" zurück
18+
3. **Versionssynchronisation** - Lokale Dateien vs. Remote Tags inkonsistent
19+
20+
## ✅ Implementierte Lösung
21+
22+
### 1. Merge-Commit-Unterstützung
23+
```yaml
24+
# Behandle Merge-Commits speziell
25+
if [[ "$COMMIT_MSG" =~ ^Merge[[:space:]]pull[[:space:]]request ]]; then
26+
echo "Merge commit detected, analyzing PR content..."
27+
# Für Merge-Commits: Minor release (neue Features zusammengeführt)
28+
SHOULD_RELEASE="true"
29+
RELEASE_TYPE="minor"
30+
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{print $1"."$2+1".0"}')
31+
```
32+
33+
### 2. Versionssynchronisation
34+
**Vor dem Fix:**
35+
- VERSION: 1.9.1
36+
- __version__.py: 1.9.1
37+
- pyproject.toml: 1.9.1
38+
- Git Tag: v1.10.0 ← Inkonsistenz!
39+
40+
**Nach dem Fix:**
41+
- VERSION: 1.10.0 ✓
42+
- __version__.py: 1.10.0 ✓
43+
- pyproject.toml: 1.10.0 ✓
44+
- Git Tag: v1.10.0 ✓
45+
46+
### 3. Verbesserte Tag-Erkennung
47+
```bash
48+
# Robustere Tag-Erkennung
49+
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
50+
LAST_TAG_VERSION=${LAST_TAG#v}
51+
echo "Last tag version: $LAST_TAG_VERSION"
52+
```
53+
54+
## 🎯 Release-Trigger-Patterns
55+
56+
### Automatische Releases:
57+
1. **Merge PR**: `Merge pull request #X` → Minor Release
58+
2. **Feature**: `feat: neue funktion` → Minor Release
59+
3. **Fix**: `fix: bugfix` → Patch Release
60+
4. **Breaking**: `feat!: breaking change` → Major Release
61+
5. **Manual**: `[release]` in Commit-Message → Patch Release
62+
63+
### Beispiel-Workflow:
64+
```bash
65+
# 1. Feature-Branch entwickeln
66+
git checkout -b feature/neue-funktion
67+
git commit -m "feat: neue coole funktion"
68+
git push origin feature/neue-funktion
69+
70+
# 2. Pull Request erstellen und mergen
71+
# → Automatisch: v1.10.0 → v1.11.0 (Minor)
72+
73+
# 3. Hotfix direkt auf main
74+
git commit -m "fix: kritischer bugfix"
75+
git push origin main
76+
# → Automatisch: v1.11.0 → v1.11.1 (Patch)
77+
```
78+
79+
## 🧪 Testing
80+
81+
### Nächster Test:
82+
1. Merge diesen PR
83+
2. Erwartetes Ergebnis:
84+
```
85+
Commit message: Merge pull request #X
86+
Current version: 1.10.0
87+
Last tag version: 1.10.0
88+
Should release: true
89+
Release type: minor
90+
New version: 1.11.0
91+
```
92+
93+
## 📋 Zukünftige Verbesserungen
94+
95+
### Option 1: Semantic Release Integration
96+
```yaml
97+
- uses: cycjimmy/semantic-release-action@v3
98+
with:
99+
semantic_version: 19
100+
branches: |
101+
[
102+
'main'
103+
]
104+
```
105+
106+
### Option 2: Automatische Version-Sync
107+
```yaml
108+
- name: Sync version files
109+
run: |
110+
NEW_VERSION=${{ steps.release.outputs.new_version }}
111+
echo "$NEW_VERSION" > VERSION
112+
sed -i "s/__version__ = \".*\"/__version__ = \"$NEW_VERSION\"/" __version__.py
113+
sed -i "s/version = \".*\"/version = \"$NEW_VERSION\"/" pyproject.toml
114+
```
115+
116+
---
117+
118+
*Problem behoben in v1.10.1* 🚀

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.9.1
1+
1.10.0

__version__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
Version information for Bash-Script-Maker
55
"""
66

7-
__version__ = "1.9.1"
8-
__version_info__ = (1, 9, 1)
7+
__version__ = "1.10.0"
8+
__version_info__ = (1, 10, 0)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "bash-script-maker"
7-
version = "1.9.1"
7+
version = "1.10.0"
88
description = "Ein GUI-Programm zur Erstellung von Bash-Scripts mit visueller Unterstützung"
99
readme = "README.md"
1010
license = {text = "MIT"}

0 commit comments

Comments
 (0)