34 lines
752 B
Bash
34 lines
752 B
Bash
#!/bin/bash
|
||
set -e
|
||
|
||
echo "> version.json oluşturuluyor..."
|
||
|
||
# En yeni tag en üstte olsun
|
||
VERSIONS=$(git tag --sort=-creatordate)
|
||
|
||
OUTPUT="{\"releases\":["
|
||
|
||
FIRST=true
|
||
for TAG in $VERSIONS; do
|
||
VER=$(echo $TAG | sed 's/^v//')
|
||
DATE=$(git log -1 --format=%ad --date=short $TAG)
|
||
COMMIT=$(git rev-list -n 1 $TAG)
|
||
|
||
# 🔑 Boş satırları filtrele
|
||
MESSAGE=$(git tag -l --format="%(contents)" $TAG | grep -v '^$' | jq -R . | jq -s .)
|
||
|
||
if [ "$FIRST" = true ]; then
|
||
FIRST=false
|
||
else
|
||
OUTPUT+=","
|
||
fi
|
||
|
||
OUTPUT+="{\"version\":\"$VER\",\"buildDate\":\"$DATE\",\"commit\":\"$COMMIT\",\"changeLog\":$MESSAGE}"
|
||
done
|
||
|
||
OUTPUT+="]}"
|
||
|
||
echo "$OUTPUT" | jq . > public/version.json
|
||
|
||
echo "> public/version.json güncellendi:"
|
||
cat public/version.json
|