Spaces:
Paused
Paused
Mirrowel commited on
Commit Β·
477f402
1
Parent(s): da32588
feat: improve changelog generation by handling tag ranges and repository URL
Browse files- .github/workflows/build.yml +8 -19
.github/workflows/build.yml
CHANGED
|
@@ -101,27 +101,16 @@ jobs:
|
|
| 101 |
id: changelog
|
| 102 |
shell: bash
|
| 103 |
run: |
|
| 104 |
-
echo "π Generating changelog for build-${{ steps.version.outputs.version }}"
|
| 105 |
-
|
| 106 |
-
# Find the last build tag
|
| 107 |
LAST_TAG=$(git describe --tags --abbrev=0 --match="build-*" 2>/dev/null || echo "")
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
echo "Last tag: ${LAST_TAG:-'None found'}"
|
| 111 |
-
echo "Current tag: $CURRENT_TAG"
|
| 112 |
-
|
| 113 |
-
# Set environment for git-cliff
|
| 114 |
-
export GIT_CLIFF_TAG="$CURRENT_TAG"
|
| 115 |
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
# First release - show last 10 commits
|
| 123 |
-
git-cliff --config cliff.toml --strip all --output changelog.md --unreleased
|
| 124 |
-
fi
|
| 125 |
|
| 126 |
# Check if changelog was generated successfully
|
| 127 |
if [ -f "changelog.md" ] && [ -s "changelog.md" ]; then
|
|
|
|
| 101 |
id: changelog
|
| 102 |
shell: bash
|
| 103 |
run: |
|
|
|
|
|
|
|
|
|
|
| 104 |
LAST_TAG=$(git describe --tags --abbrev=0 --match="build-*" 2>/dev/null || echo "")
|
| 105 |
+
RANGE="${LAST_TAG:+$LAST_TAG..HEAD}"
|
| 106 |
+
echo "π Generating changelog for build-${{ steps.version.outputs.version }} ($RANGE)"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
+
git-cliff \
|
| 109 |
+
--config cliff.toml \
|
| 110 |
+
--strip all \
|
| 111 |
+
--repository-url "https://github.com/${{ github.repository }}" \
|
| 112 |
+
--output changelog.md \
|
| 113 |
+
${RANGE:---unreleased}
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
# Check if changelog was generated successfully
|
| 116 |
if [ -f "changelog.md" ] && [ -s "changelog.md" ]; then
|