2024-12-20 16:33:09 +00:00
|
|
|
#!/bin/sh
|
2024-12-20 16:28:10 +00:00
|
|
|
|
2024-12-20 16:33:09 +00:00
|
|
|
if [ -f .botenv ]; then
|
2024-12-20 16:28:10 +00:00
|
|
|
export $(grep -v '^#' .botenv | xargs)
|
|
|
|
fi
|
|
|
|
|
|
|
|
LAST_RELEASE_FILE=/data/alaskartv/androidtv-ci/release.txt
|
|
|
|
|
|
|
|
latest_release=$(curl -s "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases/latest" | jq -r '.tag_name')
|
|
|
|
|
|
|
|
if [ "$latest_release" != "$(cat $LAST_RELEASE_FILE 2>/dev/null)" ]; then
|
|
|
|
# echo "$latest_release" > "$LAST_RELEASE_FILE"
|
|
|
|
curl -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" \
|
|
|
|
-d chat_id="$CHAT_ID" \
|
|
|
|
-d text="🚀 New Release Detected: $latest_release on $REPO_OWNER/$REPO_NAME"
|
2024-12-20 16:36:49 +00:00
|
|
|
curl -X POST "http://localhost:8080/alaskartv"
|
2024-12-20 16:28:10 +00:00
|
|
|
fi
|