2021-05-24 01:49:42 +04:30

26 lines
641 B
Bash
Executable File

#!/bin/bash
rm -rf preview/*.jar preview/*.z*
cp master/server/build/Tachidesk-*.jar preview
cp master/server/build/Tachidesk-*.z* preview
cd preview
new_jar_build=$(ls Tachidesk-*.jar)
echo "last jar build file name: $new_jar_build"
latest=$(echo $new_jar_build | sed -e's/Tachidesk-\|.jar//g')
echo "{ \"latest\": \"$latest\" }" > index.json
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git status
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Updated to $latest"
git push
else
echo "No changes to commit"
fi