Skip to content

Commit

Permalink
Revert "build: don't report to telegram as of now"
Browse files Browse the repository at this point in the history
This reverts commit 78c3b98.
  • Loading branch information
peternmuller committed Sep 24, 2024
1 parent e2d09eb commit 15a6cfd
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,48 @@ jobs:
branch: update
skip_checkout: true
file_pattern: build.md *-update.json
commit_message: Bump version ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}
commit_message: Bump version ${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}

- name: Report to Telegram
env:
TG_TOKEN: ${{ secrets.TG_TOKEN }}
if: env.TG_TOKEN != null
run: |
cd build || { echo "build folder not found"; exit 1; }
TG_CHAT="@PeterSpace10T"
NL=$'\n'
APKS=""
MODULES=""
for OUTPUT in *; do
DL_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/${{ steps.next_ver_code.outputs.NEXT_VER_CODE }}/${OUTPUT}"
if [[ $OUTPUT = *.apk ]]; then
APKS+="${NL}📦 [${OUTPUT}](${DL_URL})"
elif [[ $OUTPUT = *.zip ]]; then
MODULES+="${NL}📦 [${OUTPUT}](${DL_URL})"
fi
done
MODULES=${MODULES#"$NL"}
APKS=${APKS#"$NL"}
BODY="$(sed 's/^\* \*\*/↪ \*\*/g; s/^\* `/↪ \*\*/g; s/`/\*/g; s/^\* /\↪/g; s/\*\*/\*/g; s/###//g; s/^- /↪ /g; /^==/d;' ../build.md)"
MSG="*New Build Released! 🎉*
${BODY}
*▼ Download Links:*
*Modules:*
${MODULES}
*APKs:*
${APKS}
*By @peternoz*
*🌟 Check out my builder source:*
https://github.com/peternmuller/revanced-builder
"
echo "'$MSG'"
MSG=${MSG:0:9450}
POST="https://api.telegram.org/bot${TG_TOKEN}/sendMessage"
curl -X POST --data-urlencode "parse_mode=Markdown" --data-urlencode "disable_web_page_preview=true" --data-urlencode "text=${MSG}" --data-urlencode "chat_id=${TG_CHAT}" "$POST"

0 comments on commit 15a6cfd

Please sign in to comment.