|
47 | 47 | echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT |
48 | 48 | fi |
49 | 49 | |
| 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 | + |
50 | 82 | - name: Create Release |
51 | 83 | id: create_release |
52 | 84 | uses: actions/create-release@v1 |
|
55 | 87 | with: |
56 | 88 | tag_name: ${{ steps.get_tag.outputs.tag_name }} |
57 | 89 | 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 }} |
68 | 91 | draft: false |
69 | 92 | prerelease: false |
70 | 93 |
|
|
0 commit comments