Skip to content

Commit b94d927

Browse files
FIX (releases): Fix version generation
1 parent 11ae213 commit b94d927

File tree

2 files changed

+29
-14
lines changed

2 files changed

+29
-14
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,34 @@ jobs:
130130
COMMIT_DATE=$(echo "$line" | cut -d'|||' -f4)
131131
SHORT_HASH=${COMMIT_HASH:0:7}
132132
133-
if [[ "$COMMIT_MSG" =~ ^FEATURE[[:space:]]*\(([^)]+)\):[[:space:]]*(.*) ]]; then
134-
AREA="${BASH_REMATCH[1]}"
135-
DESC="${BASH_REMATCH[2]}"
136-
FEATURES="${FEATURES}- **${AREA}**: ${DESC} ([${SHORT_HASH}](https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}))\n"
137-
elif [[ "$COMMIT_MSG" =~ ^FIX[[:space:]]*\(([^)]+)\):[[:space:]]*(.*) ]]; then
138-
AREA="${BASH_REMATCH[1]}"
139-
DESC="${BASH_REMATCH[2]}"
140-
FIXES="${FIXES}- **${AREA}**: ${DESC} ([${SHORT_HASH}](https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}))\n"
141-
elif [[ "$COMMIT_MSG" =~ ^REFACTOR[[:space:]]*\(([^)]+)\):[[:space:]]*(.*) ]]; then
142-
AREA="${BASH_REMATCH[1]}"
143-
DESC="${BASH_REMATCH[2]}"
144-
REFACTORS="${REFACTORS}- **${AREA}**: ${DESC} ([${SHORT_HASH}](https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}))\n"
133+
# Parse commit message format: TYPE (area): description
134+
if [[ "$COMMIT_MSG" == FEATURE* ]]; then
135+
# Extract area and description
136+
TEMP="${COMMIT_MSG#FEATURE}"
137+
TEMP="${TEMP#"${TEMP%%[![:space:]]*}"}" # trim leading spaces
138+
if [[ "$TEMP" == \(* ]]; then
139+
AREA=$(echo "$TEMP" | sed 's/^(\([^)]*\)).*/\1/')
140+
DESC=$(echo "$TEMP" | sed 's/^([^)]*):[[:space:]]*//')
141+
FEATURES="${FEATURES}- **${AREA}**: ${DESC} ([${SHORT_HASH}](https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}))\n"
142+
fi
143+
elif [[ "$COMMIT_MSG" == FIX* ]]; then
144+
# Extract area and description
145+
TEMP="${COMMIT_MSG#FIX}"
146+
TEMP="${TEMP#"${TEMP%%[![:space:]]*}"}" # trim leading spaces
147+
if [[ "$TEMP" == \(* ]]; then
148+
AREA=$(echo "$TEMP" | sed 's/^(\([^)]*\)).*/\1/')
149+
DESC=$(echo "$TEMP" | sed 's/^([^)]*):[[:space:]]*//')
150+
FIXES="${FIXES}- **${AREA}**: ${DESC} ([${SHORT_HASH}](https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}))\n"
151+
fi
152+
elif [[ "$COMMIT_MSG" == REFACTOR* ]]; then
153+
# Extract area and description
154+
TEMP="${COMMIT_MSG#REFACTOR}"
155+
TEMP="${TEMP#"${TEMP%%[![:space:]]*}"}" # trim leading spaces
156+
if [[ "$TEMP" == \(* ]]; then
157+
AREA=$(echo "$TEMP" | sed 's/^(\([^)]*\)).*/\1/')
158+
DESC=$(echo "$TEMP" | sed 's/^([^)]*):[[:space:]]*//')
159+
REFACTORS="${REFACTORS}- **${AREA}**: ${DESC} ([${SHORT_HASH}](https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}))\n"
160+
fi
145161
fi
146162
fi
147163
done <<< "$COMMITS"

contribute/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ Notifications flow:
8686

8787
Extra:
8888

89-
- add versioning instead of :latest (in progress by Rostislav Dugin)
90-
- add tests running on each PR
89+
- add tests running on each PR (in progress by Rostislav Dugin)
9190
- add prettier labels to GitHub README
9291
- create pretty website like rybbit.io with demo
9392
- add HTTPS for Postgresus

0 commit comments

Comments
 (0)