-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (110 loc) · 4.78 KB
/
shrpc2i.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: SHRP CI3
on:
workflow_dispatch:
inputs:
OFFICIAL_BUILD:
description: 'set true if you wanna push Official Build'
required: false
env:
MANIFEST: "git://github.com/SHRP/platform_manifest_twrp_omni.git -b v3_10.0"
# Recovery Manifest URL with -b branch
DT_LINK: "https://github.com/Mikesew1320/TECNO-CD6-SHRP-Tree"
# Your Device Tree Link
VENDOR: "TECNO"
# Your Device's Vendor name as in used inside DT. Example: xiaomi, samsung, asus, etc.
CODENAME: "CD6"
# Your Device's Codename as in used inside DT." Example: nikel, phoenix, ginkgo, etc.
KERNEL_LINK: ""
# Your Device's Codename as in used inside DT." Example: nikel, phoenix, ginkgo, etc.
KERNEL_LINK: ""
# Kernel repo link with optional -b branch. Only for building kernel from source. Ignore if using prebuilt.
TARGET: ""
# Set as recoveryimage (or bootimage if no recovery partition avaiable)
FLAVOR: "eng"
# eng by default, change the variable if you want userdebug
SOURCE: ""
# Set as omni (or twrp if using v3_11.0)
EXTRA_CMD: ""
# For qualcomm FDE devices put git clone https://github.com/omnirom/android_vendor_qcom_opensource_commonsys --depth=1 -b android-9.0 vendor/qcom/opensource/commonsys in EXTRA CMD
# If you want to Execute any external Command Before Compilation Starts
TZ: "Asia/Kolkata"
TOKEN: ${{ secrets.BOTTOKEN }}
OFFICIAL_BUILD: ${{ github.event.inputs.OFFICIAL_BUILD }}
jobs:
shrpCI:
runs-on: ubuntu-20.04
steps:
- name: Cleaning Up Runner
uses: rokibhasansagar/slimhub_actions@main
- name: Recovery Compilation
uses: SHRP-Devices/Recovery-Compiler@release
- name: Uploading SHRP Build
run: |
cd ${BuildPath}/out/target/product/${CODENAME}/
curl -sL https://git.io/file-transfer | sh
./transfer wet *SHRP*.zip
./transfer wet *Addon*.zip
- name: PUSH To TG
run: |
cd ${BuildPath}/out/target/product/${CODENAME}/
ZIP=$(echo *stable*.zip)
sudo zip -r9 TestBuild_"${CODENAME}" $ZIP
ZIPs=$(echo TestBuild_"${CODENAME}".zip)
curl -F document=@$ZIPs "https://api.telegram.org/bot$TOKEN/sendDocument" \
-F chat_id="-1001296548298" \
-F "disable_web_page_preview=true" \
-F "parse_mode=html" \
-F caption=" <i> SHRP Recovery </i> for <b> '$VENDOR' '$CODENAME' </b> is Available for Testing Purposes Only | Build finished on <b> $(date) </b> | <i> #SHRP Recovery </i> "
ZIP=$(echo *AddonRescue*.zip)
curl -F document=@$ZIP "https://api.telegram.org/bot$TOKEN/sendDocument" \
-F chat_id="-1001296548298" \
-F "disable_web_page_preview=true" \
-F "parse_mode=html" \
-F caption=" <i> SHRP AddOnRescue </i> for <b> '$VENDOR' '$CODENAME' </b> | <i> #SHRP Recovery </i> "
- name: Pushing Build To SourceForge
run: |
if [[ "$OFFICIAL_BUILD" == "true" ]]; then
printf "Uploading to SourceForge\n"
cd ${BuildPath}/out/target/product/${CODENAME}/
sudo apt-get update -y && sudo apt-get install expect -y
expect -c '
spawn sftp ${{ secrets.SFUSER }}@frs.sourceforge.net
expect \"yes/no\"
send "yes\r"
expect \"Password\"
send "${{ secrets.SFPASS }}\r"
expect \"sftp> \"
send "cd /home/frs/project/shrp/$::env(CODENAME)/\r"
set timeout -1
send "put *stable*.zip\r"
expect "Uploading"
expect "*100%*"
expect "sftp*"
send "put *AddonRescue*.zip\r"
expect "Uploading"
expect "*100%*"
expect "sftp*"
send "bye\r"
interact
'
else
printf "Uploading to SourceForge\n"
cd ${BuildPath}/out/target/product/${CODENAME}/
sudo apt-get update -y && sudo apt-get install expect -y
expect -c '
spawn sftp ${{ secrets.SFUSER }}@frs.sourceforge.net
expect \"yes/no\"
send "yes\r"
expect \"Password\"
send "${{ secrets.SFPASS }}\r"
expect \"sftp> \"
send "cd /home/frs/project/shrp/test/\r"
set timeout -1
send "put *stable*.zip\r"
expect "Uploading"
expect "*100%*"
expect "sftp*"
send "bye\r"
interact
'
fi