feat: поддержка refactor-коммитов в release-workflow
This commit is contained in:
1 parent
e64ec077f6
commit
369ba1e43c
1 file changed
+11
-3
@@ -198,7 +198,7 @@ jobs:
|
|||||||
MAJOR=$((MAJOR + 1))
|
MAJOR=$((MAJOR + 1))
|
||||||
MINOR=0
|
MINOR=0
|
||||||
PATCH=0
|
PATCH=0
|
||||||
elif printf '%s\n' "$COMMITS" | grep -Eiq '^feat([(:! ]|$)'; then
|
elif printf '%s\n' "$COMMITS" | grep -Eiq '^(feat|refactor)([(:! ]|$)'; then
|
||||||
BUMP="minor"
|
BUMP="minor"
|
||||||
MINOR=$((MINOR + 1))
|
MINOR=$((MINOR + 1))
|
||||||
PATCH=0
|
PATCH=0
|
||||||
@@ -230,10 +230,11 @@ jobs:
|
|||||||
RANGE: ${{ steps.meta.outputs.range }}
|
RANGE: ${{ steps.meta.outputs.range }}
|
||||||
run: |
|
run: |
|
||||||
strip_prefix() {
|
strip_prefix() {
|
||||||
sed -E 's/^(feat|fix|break)([(!:]|[[:space:]])+[[:space:]]*//I'
|
sed -E 's/^(feat|fix|break|refactor)([(!:]|[[:space:]])+[[:space:]]*//I'
|
||||||
}
|
}
|
||||||
|
|
||||||
FEATURES="$(git log --no-merges --format='%s (%h)' "$RANGE" | grep -Ei '^feat([(:! ]|$)' | strip_prefix | LC_ALL=C sort -f || true)"
|
FEATURES="$(git log --no-merges --format='%s (%h)' "$RANGE" | grep -Ei '^feat([(:! ]|$)' | strip_prefix | LC_ALL=C sort -f || true)"
|
||||||
|
REFACTORS="$(git log --no-merges --format='%s (%h)' "$RANGE" | grep -Ei '^refactor([(:! ]|$)' | strip_prefix | LC_ALL=C sort -f || true)"
|
||||||
FIXES="$(git log --no-merges --format='%s (%h)' "$RANGE" | grep -Ei '^fix([(:! ]|$)' | strip_prefix | LC_ALL=C sort -f || true)"
|
FIXES="$(git log --no-merges --format='%s (%h)' "$RANGE" | grep -Ei '^fix([(:! ]|$)' | strip_prefix | LC_ALL=C sort -f || true)"
|
||||||
BREAKING="$(git log --no-merges --format='%s (%h)' "$RANGE" | grep -Ei '^break([(:! ]|$)' | strip_prefix | LC_ALL=C sort -f || true)"
|
BREAKING="$(git log --no-merges --format='%s (%h)' "$RANGE" | grep -Ei '^break([(:! ]|$)' | strip_prefix | LC_ALL=C sort -f || true)"
|
||||||
|
|
||||||
@@ -256,6 +257,13 @@ jobs:
|
|||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "$REFACTORS" ]; then
|
||||||
|
echo "### Refactoring"
|
||||||
|
echo
|
||||||
|
printf '%s\n' "$REFACTORS" | sed 's/^/- /'
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$FIXES" ]; then
|
if [ -n "$FIXES" ]; then
|
||||||
echo "### Bug Fixes"
|
echo "### Bug Fixes"
|
||||||
echo
|
echo
|
||||||
@@ -283,7 +291,7 @@ jobs:
|
|||||||
if: steps.meta.outputs.should_release != 'true'
|
if: steps.meta.outputs.should_release != 'true'
|
||||||
run: |
|
run: |
|
||||||
echo "No new semantic release created."
|
echo "No new semantic release created."
|
||||||
echo "Add a commit starting with break, feat, or fix after the latest tag."
|
echo "Add a commit starting with break, feat, fix, or refactor after the latest tag."
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
name: Publish Docker image
|
name: Publish Docker image
|
||||||
|
|||||||
Reference in new issue
Block a user