-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (117 loc) · 4.02 KB
/
builder.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Make Recovery
on:
workflow_dispatch:
inputs:
LIBRARY_NAME:
description: 'LIBRARY_NAME'
required: true
default: 'twrp'
LIBRARY_URL:
description: 'LIBRARY_URL'
required: true
default: 'git://github.com/SHRP/platform_manifest_twrp_omni.git'
LIBRARY_BRANCH:
description: 'LIBRARY_BRANCH'
required: true
default: 'v3_11.0'
DEVICE_URL:
description: 'DEVICE_URL'
required: true
default: 'https://github.com/Mikesew1320/TECNO-CD6-SHRP-Tree'
DEVICE_BRANCH:
description: 'DEVICE_BRANCH'
required: true
default: 'android-10.0'
DEVICE_PATH:
description: 'DEVICE_PATH'
required: true
default: 'device/TECNO/CD6'
DEVICE_NAME:
description: 'DEVICE_NAME'
required: true
default: 'CD6'
BUILD_TARGET:
description: 'BUILD_TARGET'
required: true
default: 'recoveryimage'
type: choice
options:
- recoveryimage
- bootimage
- vendorbootimage
jobs:
build:
if: github.event.repository.owner.id == github.event.sender.id
runs-on: ubuntu-18.04
steps:
- name: Remove Useless Package
run: |
docker rmi `docker images -q`
sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d
sudo apt -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php*
sudo apt -y autoremove --purge
sudo apt -y autoclean
sudo apt clean
- name: Maximize Build Space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 1024
swap-size-mb: 10240
remove-dotnet: 'true'
temp-reserve-mb: 1024
remove-android: 'true'
remove-haskell: 'true'
- name: Check Out
uses: actions/checkout@main
- name: Set Variables
run: |
echo "::set-output name=date::$(date +%F)"
id: var
- name: Prepare Environment
run: |
export HOME=${GITHUB_WORKSPACE}
cd ${GITHUB_WORKSPACE}
sudo apt -y install git aria2
git clone https://gitlab.com/OrangeFox/misc/scripts
cd scripts
sudo bash setup/android_build_env.sh
sudo bash setup/install_android_sdk.sh || true
- name: Init Repo
run: |
mkdir ${GITHUB_WORKSPACE}/workspace
cd ${GITHUB_WORKSPACE}/workspace
git config --global user.name "Hikaru's Action-Build-Bot"
git config --global user.email "[email protected]"
repo init --depth=1 -u ${{ github.event.inputs.LIBRARY_URL }} -b ${{ github.event.inputs.LIBRARY_BRANCH }}
- name: Repo Sync
run: |
cd ${GITHUB_WORKSPACE}/workspace
repo sync -j$(nproc --all)
ls -al
- name: Repopick Fscrypt
if: ${{ github.event.inputs.LIBRARY_URL == 'https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git' && github.event.inputs.LIBRARY_BRANCH == 'twrp-12.1' }}
run: |
cd ${GITHUB_WORKSPACE}/workspace
source build/envsetup.sh
repopick 5405
repopick 5540
repopick 5653
- name: Clone Device Tree
run: |
cd ${GITHUB_WORKSPACE}/workspace
git clone ${{ github.event.inputs.DEVICE_URL }} -b ${{ github.event.inputs.DEVICE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
- name: Building
run: |
cd ${GITHUB_WORKSPACE}/workspace
export ALLOW_MISSING_DEPENDENCIES=true
source build/envsetup.sh
lunch ${{ github.event.inputs.LIBRARY_NAME }}_${{ github.event.inputs.DEVICE_NAME }}-eng
make clean
make ${{ github.event.inputs.BUILD_TARGET }} -j$(nproc --all)
- name: Upload Articact
uses: actions/upload-artifact@v2
with:
path: |
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.img
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.zip
name: ${{ github.event.inputs.DEVICE_NAME }}