Skip to content

Commit bf9e8ad

Browse files
committed
Rewrite release workflow: individual .rb assets, improved descriptions
1 parent 4cbc6f2 commit bf9e8ad

1 file changed

Lines changed: 30 additions & 45 deletions

File tree

.github/workflows/rpgxp-release.yml

Lines changed: 30 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@ jobs:
4545
fi
4646
4747
if [ "$IS_FIRST_RELEASE" = false ]; then
48-
# Version aus dem letzten Tag parsen
4948
CURRENT=$(echo "$LATEST_TAG" | sed 's/^v//' | sed 's/-rpgxp-scripts$//')
5049
MAJOR=$(echo "$CURRENT" | cut -d. -f1)
5150
MINOR=$(echo "$CURRENT" | cut -d. -f2)
5251
PATCH=$(echo "$CURRENT" | cut -d. -f3)
5352
54-
# Prüfen ob neue Ordner hinzugefügt wurden
5553
HAS_NEW_FOLDER=false
5654
if [ -n "$DIFF" ]; then
5755
while IFS=$'\t' read -r status filepath; do
@@ -79,7 +77,7 @@ jobs:
7977
TAG_NAME="${NEW_VERSION}-rpgxp-scripts"
8078
8179
if [ -z "$DIFF" ]; then
82-
echo "Keine Script-Änderungen erkannt. Release wird übersprungen."
80+
echo "No script changes detected. Skipping release."
8381
exit 0
8482
fi
8583
@@ -93,13 +91,12 @@ jobs:
9391
while IFS=$'\t' read -r status filepath; do
9492
[ -z "$status" ] && continue
9593
folder=$(echo "$filepath" | cut -d'/' -f1)
96-
name=$(basename "$filepath")
97-
display="${name%.rb} ($folder)"
94+
readable=$(echo "$folder" | sed 's/^[0-9]*-//' | sed 's/-/ /g')
9895
9996
case "$status" in
100-
A*) scripts_added+=("$display") ;;
101-
D*) scripts_removed+=("$display") ;;
102-
*) scripts_modified+=("$display") ;;
97+
A*) scripts_added+=("$readable") ;;
98+
D*) scripts_removed+=("$readable") ;;
99+
*) scripts_modified+=("$readable") ;;
103100
esac
104101
done <<< "$DIFF"
105102
@@ -111,83 +108,71 @@ jobs:
111108
BODY=""
112109
RELEASE_DATE=$(date -u +"%d-%m-%Y")
113110
RELEASE_TIME=$(date -u +"%I:%M %p UTC")
114-
BODY+="**Released: $RELEASE_DATE at $RELEASE_TIME**"$'\n\n'
111+
BODY+="**Release: $RELEASE_DATE at $RELEASE_TIME**"$'\n\n'
115112
116113
if [ "$IS_FIRST_RELEASE" = true ]; then
117-
BODY+="Initial release containing $total_files RPG Maker XP scripts across all script collections."$'\n\n'
114+
BODY+="This release contains $total_files RPG Maker XP scripts designed to improve gameplay mechanics and visual presentation. Each script is a drop-in replacement that maintains full compatibility with the standard RPG Maker XP framework while adding new functionality."$'\n\n'
118115
119-
BODY+="**Included Scripts ($total_files)**"$'\n\n'
120116
for s in "${scripts_added[@]}"; do
121-
BODY+="• ⠀**${s}** added"$'\n'
117+
BODY+="• ⠀Added ${s}"$'\n'
122118
done
123-
BODY+=$'\n'
124119
else
125120
parts=()
126121
[ $count_added -gt 0 ] && parts+=("$count_added added")
127-
[ $count_modified -gt 0 ] && parts+=("$count_modified modified")
122+
[ $count_modified -gt 0 ] && parts+=("$count_modified updated")
128123
[ $count_removed -gt 0 ] && parts+=("$count_removed removed")
129124
summary=$(IFS=", "; echo "${parts[*]}")
130-
BODY+="Update with $summary script(s)."$'\n\n'
125+
BODY+="This release includes ${summary} script(s)."$'\n\n'
131126
132127
if [ $count_added -gt 0 ]; then
133-
BODY+="**Added ($count_added)**"$'\n\n'
134128
for s in "${scripts_added[@]}"; do
135-
BODY+="• ⠀**${s}** added"$'\n'
129+
BODY+="• ⠀Added ${s}"$'\n'
136130
done
137-
BODY+=$'\n'
138131
fi
139132
140133
if [ $count_modified -gt 0 ]; then
141-
BODY+="**Modified ($count_modified)**"$'\n\n'
142134
for s in "${scripts_modified[@]}"; do
143-
BODY+="• ⠀**${s}** updated"$'\n'
135+
BODY+="• ⠀Enhanced ${s}"$'\n'
144136
done
145-
BODY+=$'\n'
146137
fi
147138
148139
if [ $count_removed -gt 0 ]; then
149-
BODY+="**Removed ($count_removed)**"$'\n\n'
150140
for s in "${scripts_removed[@]}"; do
151-
BODY+="• ⠀~~${s}~~ removed"$'\n'
141+
BODY+="• ⠀Removed ~~${s}~~"$'\n'
152142
done
153-
BODY+=$'\n'
154143
fi
155144
fi
156145
157-
# ── ZIP-Asset erstellen
158-
echo "Creating release archive..."
146+
BODY+=$'\n'"**Note:** If you encounter any bugs or issues, please don't hesitate to open an issue. For any questions or to start a discussion, feel free to initiate a discussion on the GitHub repository."
159147
160-
if [ "$IS_FIRST_RELEASE" = true ]; then
161-
find . -name "*.rb" -not -path "./.git/*" | zip -@ -q /tmp/rpgxp-scripts.zip
162-
else
163-
FILE_LIST=""
164-
while IFS=$'\t' read -r status filepath; do
165-
[ -z "$status" ] && continue
166-
[[ "$status" == D* ]] && continue
167-
[ -f "$filepath" ] && FILE_LIST+="$filepath"$'\n'
168-
done <<< "$DIFF"
169-
170-
if [ -z "$FILE_LIST" ]; then
171-
echo "No files to include in the release asset."
172-
exit 0
173-
fi
148+
# ── Release-Assets sammeln (einzelne .rb Dateien)
149+
ASSET_FILES=()
150+
while IFS=$'\t' read -r status filepath; do
151+
[ -z "$status" ] && continue
152+
[[ "$status" == D* ]] && continue
153+
[ -f "$filepath" ] && ASSET_FILES+=("$filepath")
154+
done <<< "$DIFF"
174155
175-
echo -n "$FILE_LIST" | zip -@ -q /tmp/rpgxp-scripts.zip
156+
if [ ${#ASSET_FILES[@]} -eq 0 ]; then
157+
echo "No files to include in the release."
158+
exit 0
176159
fi
177160
178-
DATA_SIZE=$(du -h /tmp/rpgxp-scripts.zip | cut -f1)
179-
echo " Archive size: $DATA_SIZE"
161+
echo "Assets to upload (${#ASSET_FILES[@]}):"
162+
printf " %s\n" "${ASSET_FILES[@]}"
180163
181164
# ── Release erstellen
182165
echo "$BODY" > /tmp/release_notes.md
166+
echo ""
183167
echo "Release Notes:"
184168
cat /tmp/release_notes.md
169+
echo ""
185170
186171
echo "Creating release: $TAG_NAME"
187172
gh release create "$TAG_NAME" \
188-
/tmp/rpgxp-scripts.zip \
173+
"${ASSET_FILES[@]}" \
189174
--title "RPG Maker XP Script Library $NEW_VERSION" \
190175
--notes-file /tmp/release_notes.md \
191176
--latest
192177
193-
echo "Release '$TAG_NAME' successfully created!"
178+
echo "Release '$TAG_NAME' created successfully!"

0 commit comments

Comments
 (0)