Skip to content

Commit 4bf4c6b

Browse files
authored
Update release.yml
1 parent cece72d commit 4bf4c6b

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,16 @@ jobs:
112112
git push origin HEAD:main
113113
git push origin --tags
114114
115-
- name: Build .pak and prepare ZIP
115+
- name: Build .pak, commit and prepare ZIP
116116
run: |
117117
TMP_DIR=temp__kcdutils
118118
PAK_DIR="$TMP_DIR/_kcdutils/Data"
119119
PAK_FILE="$PAK_DIR/kcdutils.pak"
120-
120+
121121
# 1) Sauberen temporären Ordner erstellen
122122
rm -rf "$TMP_DIR"
123123
mkdir -p "$PAK_DIR"
124-
124+
125125
# 2) .pak bauen
126126
python3 - <<EOF
127127
import zipfile, os
@@ -134,14 +134,28 @@ jobs:
134134
rel_path = os.path.relpath(abs_path, base_folder)
135135
archive.write(abs_path, rel_path)
136136
EOF
137-
138-
# 3) Restliche Dateien ins temporäre Verzeichnis kopieren
139-
shopt -s dotglob
140-
for f in *; do
141-
if [[ "$f" != "$TMP_DIR" && "$f" != ".git" && "$f" != ".github" ]]; then
142-
cp -r "$f" "$TMP_DIR/_kcdutils/"
143-
fi
144-
done
137+
138+
# 3) .pak ins Repo kopieren
139+
cp "$PAK_FILE" "KCDUtils/Data/kcdutils.pak"
140+
141+
# 4) Commit nur, wenn sich etwas geändert hat
142+
git add KCDUtils/Data/kcdutils.pak
143+
if ! git diff --cached --quiet; then
144+
git commit -m "chore: rebuild kcdutils.pak for version $NEW_VERSION [skip ci]"
145+
git push origin HEAD:main
146+
else
147+
echo "No changes in kcdutils.pak, skipping commit"
148+
fi
149+
150+
# 5) Restliche Dateien ins temporäre Verzeichnis kopieren für ZIP
151+
shopt -s dotglob
152+
mkdir -p "$TMP_DIR/_kcdutils"
153+
for f in *; do
154+
if [[ "$f" != "$TMP_DIR" && "$f" != ".git" && "$f" != ".github" ]]; then
155+
cp -r "$f" "$TMP_DIR/_kcdutils/"
156+
fi
157+
done
158+
145159
146160
- name: Create ZIP
147161
env:

0 commit comments

Comments
 (0)