Skip to content

Commit 579dd86

Browse files
committed
Красивые changelogs, 1.21.11 API
1 parent f5db3f4 commit 579dd86

File tree

3 files changed

+40
-11
lines changed

3 files changed

+40
-11
lines changed

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

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,43 @@ jobs:
9393
needs: [extract-version, create-tag]
9494
runs-on: ubuntu-latest
9595
if: needs.extract-version.outputs.tag_exists == 'false'
96+
outputs:
97+
changelog: ${{ steps.generate_changelog.outputs.CHANGELOG }}
9698
steps:
99+
- name: Checkout code
100+
uses: actions/checkout@v4
101+
with:
102+
fetch-depth: 0
103+
token: ${{ secrets.PAT }}
104+
105+
- name: Generate changelog with commit links
106+
id: generate_changelog
107+
run: |
108+
REPO="${{ github.repository }}"
109+
PREV_TAG=$(git describe --tags --abbrev=0 --exclude="v${{ needs.extract-version.outputs.version }}" HEAD~1 2>/dev/null || echo "")
110+
if [ -z "$PREV_TAG" ]; then
111+
COMMITS=$(git log --oneline --no-decorate)
112+
else
113+
COMMITS=$(git log "${PREV_TAG}..HEAD" --oneline --no-decorate)
114+
fi
115+
116+
if [ -z "$COMMITS" ]; then
117+
CHANGELOG="Нет изменений"
118+
else
119+
while IFS= read -r line; do
120+
if [ -n "$line" ]; then
121+
COMMIT_HASH=$(echo "$line" | cut -d' ' -f1)
122+
COMMIT_MSG=$(echo "$line" | cut -d' ' -f2-)
123+
echo "- [$COMMIT_HASH](https://github.com/$REPO/commit/$COMMIT_HASH) $COMMIT_MSG"
124+
fi
125+
done <<< "$COMMITS" > /tmp/changelog.md
126+
CHANGELOG=$(cat /tmp/changelog.md)
127+
fi
128+
129+
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
130+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
131+
echo "EOF" >> $GITHUB_OUTPUT
132+
97133
- name: Download artifact
98134
uses: actions/download-artifact@v4
99135
with:
@@ -107,8 +143,8 @@ jobs:
107143
with:
108144
tag_name: v${{ needs.extract-version.outputs.version }}
109145
name: v${{ needs.extract-version.outputs.version }}
146+
body: ${{ steps.generate_changelog.outputs.CHANGELOG }}
110147
files: "**/*.jar"
111-
generate_release_notes: true
112148
env:
113149
GITHUB_TOKEN: ${{ secrets.PAT }}
114150

@@ -134,19 +170,12 @@ jobs:
134170
name: v${{ needs.extract-version.outputs.version }}
135171
version: ${{ needs.extract-version.outputs.version }}
136172
version-type: release
137-
changelog: Автоматический релиз v${{ needs.extract-version.outputs.version }}
173+
changelog: ${{ needs.release.outputs.changelog }}
138174

139175
files: "**/*.jar"
140176

141177
game-versions: |
142178
1.21.11
143-
1.21.10
144-
1.21.9
145-
1.21.8
146-
1.21.7
147-
1.21.6
148-
1.21.5
149-
1.21.4
150179
151180
loaders: |
152181
paper

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.trassert</groupId>
77
<artifactId>RecallPotion</artifactId>
8-
<version>1.6.0</version>
8+
<version>1.6.1</version>
99
<packaging>jar</packaging>
1010

1111
<name>Return Potion</name>

src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: RecallPotion
22
version: ${project.version}
33
main: com.trassert.recallpotion.RecallPotionPlugin
4-
api-version: '1.21'
4+
api-version: '1.21.11'
55
description: A plugin that adds recall potions to Minecraft
66
author: trassert
77
folia-supported: true

0 commit comments

Comments
 (0)