-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathupload_final
More file actions
35 lines (26 loc) · 1.43 KB
/
upload_final
File metadata and controls
35 lines (26 loc) · 1.43 KB
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
#!/bin/bash
function tg_sendText() {
curl -s "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" \
-d "parse_mode=html" \
-d text="${1}" \
-d chat_id=$CHAT_ID \
-d "disable_web_page_preview=true"
}
function tg_sendFile() {
curl -F chat_id=$CHAT_ID -F document=@${1} -F parse_mode=markdown https://api.telegram.org/bot$BOT_TOKEN/sendDocument
}
# Upload function for uploading rom zip file if you don't want to use google drive !
up() {
curl --upload-file $1 https://transfer.sh/ | tee download.txt
}
cd /tmp/rom # Depends on where source got synced.
# METHOD 1: Upload to transfer.sh for free temporary storage
#tg_sendText "Uploading final zip(s) to transfer.sh.."
#up out/target/product/a10/*.zip
#tg_sendFile "download.txt"
# METHOD 2: Uploading to Google Drive because it has high upload speed (> 40 mb/s)
tg_sendText "Uploading zip(s) to Google Drive.."
time rclone copy out/target/product/a20e/ProjectSakura-5.R-VANILLA*.zip aosp:final -P # aosp is my rclone config name (first line without [] of ~/.config/rclone/rclone.conf file from rclone setupped pc) "final" is where roms will be saved in my cloud.
sleep 2s
time rclone copy out/target/product/a20e/*.zip aosp:final -P # Different roms have different output names. This one will upload a zip in case you did not give a proper name above. A win-win situation!
tg_sendText "Uploaded ROM to Drive. Get it here-> https://drive.google.com/drive/folders/1V0L-gXvfMIe06YYsFG1FQcgyyeQbA3Gz?usp=sharing"