-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
75 lines (75 loc) · 4.66 KB
/
.travis.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
os: linux
dist: focal
group: edge
language: generic
git:
depth: 1
addons:
apt:
update:
- true
packages:
- aria2
- zstd
- xz-utils
services:
- docker
before_install:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin 2>/dev/null
- docker pull fr3akyphantom/droid-builder:latest
before_script:
- cd $HOME && mkdir twrp
# Download the TWRP Compressed Source Files from PhantomZone54's Release
# > More on https://github.com/PhantomZone54/twrp_sources_norepo/releases/latest
# Uncomment & Use below line If Building for Lollipop-based Devices
# - TWRP_SOURCE="https://github.com/PhantomZone54/twrp_sources_norepo/releases/download/v3.4.0-20201103/MinimalOmniRecovery-twrp-5.1-norepo-20201103.tzst"
# Use below line If Building for Marshmallow-based Devices
- TWRP_SOURCE="https://github.com/PhantomZone54/twrp_sources_norepo/releases/download/v3.4.0-20201103/MinimalOmniRecovery-twrp-6.0-norepo-20201103.tzst"
# Uncomment & Use below line If Building for Nougat-based Devices
# - TWRP_SOURCE="https://github.com/PhantomZone54/twrp_sources_norepo/releases/download/v3.4.0-20201103/MinimalOmniRecovery-twrp-7.1-norepo-20201103.tzst"
- aria2c -x16 -s8 --console-log-level=error --summary-interval=0 "${TWRP_SOURCE}" -o twrp.tzst || wget -q --show-progress --progress=bar:force "${TWRP_SOURCE}" -O twrp.tzst
- tar --zstd -xf twrp.tzst --directory $HOME/twrp/ && rm twrp.tzst
# If Building for Oreo-based Devices
# - TWRP_SOURCE1="https://github.com/PhantomZone54/twrp_sources_norepo/releases/download/v3.4.0-20201103/MinimalOmniRecovery-twrp-8.1-norepo-20201103.tzst.aa" && TWRP_SOURCE2="https://github.com/PhantomZone54/twrp_sources_norepo/releases/download/v3.4.0-20201103/MinimalOmniRecovery-twrp-8.1-norepo-20201103.tzst.ab"
# If Building for Oreo-based Devices
# - TWRP_SOURCE1="https://github.com/PhantomZone54/twrp_sources_norepo/releases/download/v3.4.0-20201103/MinimalOmniRecovery-twrp-9.0-norepo-20201103.tzst.aa" && TWRP_SOURCE2="https://github.com/PhantomZone54/twrp_sources_norepo/releases/download/v3.4.0-20201103/MinimalOmniRecovery-twrp-9.0-norepo-20201103.tzst.ab" && TWRP_SOURCE3="https://github.com/PhantomZone54/twrp_sources_norepo/releases/download/v3.4.0-20201103/MinimalOmniRecovery-twrp-9.0-norepo-20201103.tzst.ac" && TWRP_SOURCE4="https://github.com/PhantomZone54/twrp_sources_norepo/releases/download/v3.4.0-20201103/MinimalOmniRecovery-twrp-9.0-norepo-20201103.tzst.ad"
# Then uncomment below lines to download & extract the multi-part files
# - aria2c -x16 -s8 --console-log-level=error --summary-interval=0 "${TWRP_SOURCE1}" "${TWRP_SOURCE2}" "${TWRP_SOURCE3}" "${TWRP_SOURCE4}" || wget -q --show-progress --progress=bar:force "${TWRP_SOURCE1}" "${TWRP_SOURCE2}" "${TWRP_SOURCE3}" "${TWRP_SOURCE4}"
# - tar --zstd -xf MinimalOmniRecovery-twrp-*.*-norepo-2020*.tzst.aa --directory $HOME/twrp/ && rm MinimalOmniRecovery*.tzst.*
script:
# Replace your ${_USERNAME_}, ${_REPO_SLUG_}, ${_VENDORNAME_}, ${_CODENAME_}
- cd $HOME/twrp/ && git clone https://github.com/${_USERNAME_}/${_REPO_SLUG_}.git device/${_VENDORNAME_}/${_CODENAME_}
- rm -rf bootable/recovery && git clone https://github.com/omnirom/android_bootable_recovery -b android-9.0 --depth 1 bootable/recovery
- |
docker run --rm -i -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -v "$(pwd):/home/builder/twrp/:rw,z" -v "${HOME}/.ccache:/srv/ccache:rw,z" fr3akyphantom/droid-builder bash << EOF
cd /home/builder/twrp/
source build/envsetup.sh
# Choose build flavor as "eng" or "userdebug"
BUILD_FLAVOR="eng"
lunch omni_${_CODENAME_}-${BUILD_FLAVOR}
make -j$(nproc --all) recoveryimage
exit
EOF
after_success:
- export version=$(cat bootable/recovery/variables.h | grep "define TW_MAIN_VERSION_STR" | cut -d '"' -f2)
- cp $HOME/twrp/out/target/product/${_CODENAME_}/recovery.img $HOME/twrp/TWRP-$version-${_CODENAME_}-$(date +"%Y%m%d")-Unofficial.img
- cd $HOME/twrp/
# Optional: You might need to switch from https://transfer.sh to https://file.io
# - curl -s --upload-file TWRP-$version-${_CODENAME_}-$(date +"%Y%m%d")-Unofficial.img https://transfer.sh/ && echo ""
deploy:
provider: releases
# The secret api_key will be loaded from the environment variables
token: $GitOAUTHToken
cleanup: false
file_glob: true
file: $HOME/twrp/*.img
on:
tags: false # Set "true" to deploy only on successful tagged commit builds
repo: ${_USERNAME_}/${_REPO_SLUG_} # Optional: If you want to deploy on different repository
branch: master # Optional: Needs to be exact as the config branch
branches:
only:
- master # Set travis builder branch(es) names
except:
- /^(?i:untagged)-.*$/
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/