File tree Expand file tree Collapse file tree 2 files changed +40
-25
lines changed Expand file tree Collapse file tree 2 files changed +40
-25
lines changed Original file line number Diff line number Diff line change 1+ name : Telegram
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ jobs :
8+ get-latest-release :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout repository
12+ uses : actions/checkout@v4
13+
14+ - name : Send APK links to Telegram
15+ env :
16+ TELEGRAM_BOT_TOKEN : ${{ secrets.TELEGRAM_BOT_TOKEN }}
17+ TELEGRAM_CHAT_ID : ${{ secrets.TELEGRAM_CHAT_ID }}
18+ VERSION : ${{ github.event.release.tag_name }}
19+ run : |
20+ repo_url=$(git remote get-url origin)
21+ username=$(echo "$repo_url" | sed -E 's#.*github.com[:/](.*)/(.*).git#\1#')
22+ repo_name=$(echo "$repo_url" | sed -E 's#.*github.com[:/](.*)/(.*).git#\2#')
23+ architectures=("arm64-v8a" "armeabi-v7a" "universal" "x86" "x86_64")
24+ NL="%0A"
25+
26+ MESSAGE="🚀 *New Release Available! $VERSION*$NL$NL"
27+
28+ MESSAGE+="${{ github.event.release.body }}$NL"
29+
30+ for arch in "${architectures[@]}"; do
31+ name="hviewer-$VERSION-$arch-release.apk"
32+ MESSAGE+="🔹 [$name](https://github.com/$username/$repo_name/releases/latest/download/$name)$NL"
33+ done
34+
35+ echo $MESSAGE
36+
37+ curl -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \
38+ -d "chat_id=$TELEGRAM_CHAT_ID" \
39+ -d "parse_mode=Markdown" \
40+ -d "text=$MESSAGE"
Original file line number Diff line number Diff line change 7474 fail_on_unmatched_files : true
7575 make_latest : true
7676
77- - name : Send APK links to Telegram
78- env :
79- TELEGRAM_BOT_TOKEN : ${{ secrets.TELEGRAM_BOT_TOKEN }}
80- TELEGRAM_CHAT_ID : ${{ secrets.TELEGRAM_CHAT_ID }}
81- VERSION : ${{ github.ref_name }}
82- run : |
83- repo_url=$(git remote get-url origin)
84- username=$(echo "$repo_url" | sed -E 's#.*github.com[:/](.*)/(.*).git#\1#')
85- repo_name=$(echo "$repo_url" | sed -E 's#.*github.com[:/](.*)/(.*).git#\2#')
86- architectures=("arm64-v8a" "armeabi-v7a" "universal" "x86" "x86_64")
87- NL="%0A"
88-
89- MESSAGE="🚀 *New Release Available! $VERSION*$NL$NL"
90-
91- for arch in "${architectures[@]}"; do
92- name="hviewer-$VERSION-$arch-release.apk"
93- MESSAGE+="🔹 [$name](https://github.com/$username/$repo_name/releases/latest/download/$name)$NL"
94- done
95-
96- echo $MESSAGE
97-
98- curl -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \
99- -d "chat_id=$TELEGRAM_CHAT_ID" \
100- -d "parse_mode=Markdown" \
101- -d "text=$MESSAGE"
You can’t perform that action at this time.
0 commit comments