feat(workflow): add changelog extraction step to Gitea release workflow for improved release notes
All checks were successful
Release Build / build-and-release (push) Successful in 2m27s
All checks were successful
Release Build / build-and-release (push) Successful in 2m27s
This commit is contained in:
@@ -21,6 +21,23 @@ jobs:
|
|||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: sh gradlew build --no-daemon
|
run: sh gradlew build --no-daemon
|
||||||
|
|
||||||
|
- name: Extract Changelog
|
||||||
|
id: changelog
|
||||||
|
run: |
|
||||||
|
# Extract the latest version section from CHANGELOG.md
|
||||||
|
if [ -f "docs/CHANGELOG.md" ]; then
|
||||||
|
# Get content between first ## and second ## (or end of file)
|
||||||
|
CHANGELOG=$(sed -n '/^## \[/,/^## \[/p' docs/CHANGELOG.md | sed '$d' | tail -n +2)
|
||||||
|
if [ -z "$CHANGELOG" ]; then
|
||||||
|
CHANGELOG=$(sed -n '/^## \[/,$p' docs/CHANGELOG.md | tail -n +2)
|
||||||
|
fi
|
||||||
|
echo "RELEASE_NOTES<<EOF" >> $GITHUB_OUTPUT
|
||||||
|
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
||||||
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "RELEASE_NOTES=Release ${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: akkuman/gitea-release-action@v1
|
uses: akkuman/gitea-release-action@v1
|
||||||
with:
|
with:
|
||||||
@@ -28,4 +45,5 @@ jobs:
|
|||||||
files: build/libs/*.jar
|
files: build/libs/*.jar
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
body: ${{ steps.changelog.outputs.RELEASE_NOTES }}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user