This repository has been archived by the owner on May 11, 2024. It is now read-only.
forked from JarlPenguin/releases
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.sh
67 lines (56 loc) · 3.85 KB
/
upload.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
export tag=$(echo "$(env TZ="$timezone" date +%Y%m%d%H%M)-$zip_name" | sed 's|.zip||')
echo "--- Uploading... ---"
github-release "$RELEASE_REPO" "$tag" "main" "$ROM for $DEVICE
Date: $(env TZ="$timezone" date)" "$finalzip_path*"
if [ "$generate_incremental" == "true" ]; then
if [ -e "$incremental_zip_path" ] && [ "$old_target_files_exists" == "true" ]; then
github-release "$RELEASE_REPO" "$tag" "main" "$ROM for $DEVICE
Date: $(env TZ="$timezone" date)" "$incremental_zip_path"
elif [ ! -e "$incremental_zip_path" ] && [ "$old_target_files_exists" == "true" ]; then
echo "Build failed in $((BUILD_DIFF / 60)) minute(s) and $((BUILD_DIFF % 60)) seconds"
telegram -N -M "Build failed in $((BUILD_DIFF / 60)) minute(s) and $((BUILD_DIFF % 60)) seconds"
curl --data parse_mode=HTML --data chat_id="$TELEGRAM_CHAT" --data sticker=CAADBQADGgEAAixuhBPbSa3YLUZ8DBYE --request POST https://api.telegram.org/bot$TELEGRAM_TOKEN/sendSticker
exit 1
fi
fi
if [ "$upload_recovery" == "true" ]; then
if [ -e "$img_path" ]; then
github-release "$RELEASE_REPO" "$tag" "main" "$ROM for $DEVICE
Date: $(env TZ="$timezone" date)" "$img_path"
else
echo "Build failed in $((BUILD_DIFF / 60)) minute(s) and $((BUILD_DIFF % 60)) seconds"
exit 1
fi
fi
echo "--- Upload done ---"
if [ "$upload_recovery" == "true" ]; then
if [ "$old_target_files_exists" == "true" ]; then
telegram -M "Build completed successfully in $((BUILD_DIFF / 60)) minute(s) and $((BUILD_DIFF % 60)) seconds
Download ROM: [$zip_name](\"https://github.com/$RELEASE_REPO/releases/download/$tag/$zip_name\")
Download incremental update: [incremental_ota_update.zip](\"https://github.com/$RELEASE_REPO/releases/download/$tag/incremental_ota_update.zip\")
Download recovery: [recovery.img](\"https://github.com/$RELEASE_REPO/releases/download/$tag/recovery.img\")"
export FULL_DL_LINK="https://github.com/$RELEASE_REPO/releases/download/$tag/$zip_name"
export INCREMENTAL_DL_LINK="https://github.com/$RELEASE_REPO/releases/download/$tag/incremental_ota_update.zip"
export RECOVERY_DL_LINK="https://github.com/$RELEASE_REPO/releases/download/$tag/recovery.img"
else
telegram -M "Build completed successfully in $((BUILD_DIFF / 60)) minute(s) and $((BUILD_DIFF % 60)) seconds
Download ROM: [$zip_name](\"https://github.com/$RELEASE_REPO/releases/download/$tag/$zip_name\")
Download recovery: [recovery.img](\"https://github.com/$RELEASE_REPO/releases/download/$tag/recovery.img\")"
export FULL_DL_LINK="https://github.com/$RELEASE_REPO/releases/download/$tag/$zip_name"
export RECOVERY_DL_LINK="https://github.com/$RELEASE_REPO/releases/download/$tag/recovery.img"
fi
else
if [ "$old_target_files_exists" == "true" ]; then
telegram -M "Build completed successfully in $((BUILD_DIFF / 60)) minute(s) and $((BUILD_DIFF % 60)) seconds
Download: [$zip_name](\"https://github.com/$RELEASE_REPO/releases/download/$tag/$zip_name\")
Download incremental update: [incremental_ota_update.zip](\"https://github.com/$RELEASE_REPO/releases/download/$tag/incremental_ota_update.zip\")"
export FULL_DL_LINK="https://github.com/$RELEASE_REPO/releases/download/$tag/$zip_name"
export INCREMENTAL_DL_LINK="https://github.com/$RELEASE_REPO/releases/download/$tag/incremental_ota_update.zip"
else
telegram -M "Build completed successfully in $((BUILD_DIFF / 60)) minute(s) and $((BUILD_DIFF % 60)) seconds
Download: [$zip_name](\"https://github.com/$RELEASE_REPO/releases/download/$tag/$zip_name\")"
export FULL_DL_LINK="https://github.com/$RELEASE_REPO/releases/download/$tag/$zip_name"
fi
fi
curl --data parse_mode=HTML --data chat_id="$TELEGRAM_CHAT" --data sticker=CAADBQADGgEAAixuhBPbSa3YLUZ8DBYE --request POST https://api.telegram.org/bot"$TELEGRAM_TOKEN"/sendSticker