Skip to content

Commit cc5ec97

Browse files
committed
Attempt cool looking release message
1 parent 00f2d1f commit cc5ec97

1 file changed

Lines changed: 33 additions & 10 deletions

File tree

.github/workflows/build-and-release.yml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,38 @@ jobs:
4747
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
4848
fi
4949
50+
- name: Generate changelog
51+
id: changelog
52+
run: |
53+
git fetch --tags
54+
current_tag=${{ steps.get_tag.outputs.tag_name }}
55+
previous_tag=$(git tag --sort=-version:refname | sed -n '2p' || echo "")
56+
if [ -n "$previous_tag" ]; then
57+
commits=$(git log --oneline $previous_tag..$current_tag)
58+
body="Automated release of Offstyle Database plugin
59+
60+
## Changes
61+
$commits
62+
63+
## Installation
64+
1. Download \`offstyledb.smx\`
65+
2. Upload to your SourceMod plugins directory
66+
3. Restart your server or use \`sm plugins reload offstyledb\`"
67+
else
68+
body="Automated release of Offstyle Database plugin
69+
70+
## Changes
71+
- Initial release
72+
73+
## Installation
74+
1. Download \`offstyledb.smx\`
75+
2. Upload to your SourceMod plugins directory
76+
3. Restart your server or use \`sm plugins reload offstyledb\`"
77+
fi
78+
echo "body<<EOF" >> $GITHUB_OUTPUT
79+
echo "$body" >> $GITHUB_OUTPUT
80+
echo "EOF" >> $GITHUB_OUTPUT
81+
5082
- name: Create Release
5183
id: create_release
5284
uses: actions/create-release@v1
@@ -55,16 +87,7 @@ jobs:
5587
with:
5688
tag_name: ${{ steps.get_tag.outputs.tag_name }}
5789
release_name: Release ${{ steps.get_tag.outputs.tag_name }}
58-
body: |
59-
Automated release of Offstyle Database plugin
60-
61-
## Changes
62-
- Compiled SourcePawn plugin ready for deployment
63-
64-
## Installation
65-
1. Download `offstyledb.smx`
66-
2. Upload to your SourceMod plugins directory
67-
3. Restart your server or use `sm plugins reload offstyledb`
90+
body: ${{ steps.changelog.outputs.body }}
6891
draft: false
6992
prerelease: false
7093

0 commit comments

Comments
 (0)