Skip to content

Commit 9533f4e

Browse files
committed
build: generate proper release title and description
1 parent 3d0cf18 commit 9533f4e

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,26 @@ jobs:
3434
run: |
3535
./build.sh build
3636
37-
- run: |
38-
set -x
39-
tag_name="${GITHUB_REF##*/}"
40-
gh release create "$tag_name" build/*
37+
- name: Generate changelog
38+
id: changelog
39+
run: |
40+
# Get the previous tag (if any)
41+
previous_tag=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
42+
if [ -n "$previous_tag" ]; then
43+
log=$(git log --pretty=format:"%s" "$previous_tag"..HEAD)
44+
else
45+
log=$(git log --pretty=format:"%s")
46+
fi
47+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
48+
echo "$log" >> $GITHUB_OUTPUT
49+
echo "EOF" >> $GITHUB_OUTPUT
50+
51+
- name: Create GitHub Release (draft)
52+
uses: softprops/action-gh-release@v1
53+
with:
54+
tag_name: ${{ github.ref_name }}
55+
name: ${{ github.ref_name }}
56+
body: ${{ steps.changelog.outputs.changelog }}
57+
draft: true
4158
env:
4259
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)