forked from wanghaobai/Action-Recovery-builder
-
Notifications
You must be signed in to change notification settings - Fork 2
/
compiler.yml
129 lines (116 loc) · 4.88 KB
/
compiler.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 nabu Recovery
on:
workflow_dispatch:
inputs:
LIBRARY_NAME:
description: 'LIBRARY_NAME'
required: true
default: 'twrp'
LIBRARY_URL:
description: 'LIBRARY_URL'
required: true
default: 'https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp'
LIBRARY_BRANCH:
description: 'LIBRARY_BRANCH'
required: true
default: 'twrp-11'
DEVICE_URL:
description: 'DEVICE_URL'
required: true
default: 'https://github.com/bm0x/twrp_device_xiaomi_nabu'
DEVICE_BRANCH:
description: 'DEVICE_BRANCH'
required: true
default: '11'
DEVICE_PATH:
description: 'DEVICE_PATH'
required: true
default: 'device/xiaomi/nabu'
DEVICE_NAME:
description: 'DEVICE_NAME'
required: true
default: 'nabu'
env:
TZ: Asia/Shanghai
jobs:
build:
if: github.event.repository.owner.id == github.event.sender.id
runs-on: ubuntu-18.04
steps:
- name: Maximize build disk space
uses: easimon/maximize-build-space@v5
with:
root-reserve-mb: 1024
swap-size-mb: 6144
remove-dotnet: 'true'
temp-reserve-mb: 1024
remove-android: 'true'
remove-haskell: 'true'
- name: Check Out
uses: actions/checkout@main
- name: Prepare the environment
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
sudo apt update
sudo apt -y install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev tree lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip jq bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev imagemagick libbz2-dev libssl-dev lzma ncftp bash-completion python openjdk-8-jdk qemu-user-static
- name: Set variables
run: |
echo "::set-output name=date::$(date +%F)"
id: var
- name: Install repo
run: |
mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH
- name: Initialize repo
run: |
PATH=~/bin:$PATH
mkdir workspace
cd workspace
echo "::set-output name=pwd::$(pwd)"
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 }}
id: pwd
- name: Repo Sync
run: |
PATH=~/bin:$PATH
cd workspace
repo sync -j$(nproc --all)
- name: Clone device
run: |
PATH=~/bin:$PATH
cd ${{ steps.pwd.outputs.pwd }}
git clone ${{ github.event.inputs.DEVICE_URL }} -b ${{ github.event.inputs.DEVICE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
git clone https://github.com/LineageOS/android_hardware_xiaomi.git -b lineage-18.1 ./hardware/xiaomi
git clone https://github.com/bm0x/proprietary_vendor_xiaomi_nabu -b 11 vendor/xiaomi/nabu
git clone https://github.com/bm0x/android_device_xiaomi_sm8150-common -b lineage-18.1 device/xiaomi/sm8150-common
git clone https://github.com/bm0x/nabu-qcom-caf_display -b twrp hardware/qcom-caf/sm8150/display
git clone https://github.com/LineageOS/android_device_qcom_sepolicy_vndr -b lineage-18.1 device/qcom/sepolicy_vndr
- name: Building
run: |
PATH=~/bin:$PATH
cd ${{ steps.pwd.outputs.pwd }}
export ALLOW_MISSING_DEPENDENCIES=true
export LC_ALL=C
source build/envsetup.sh
lunch ${{ github.event.inputs.LIBRARY_NAME }}_${{ github.event.inputs.DEVICE_NAME }}-eng
make clean && make clobber
mka adbd bootimage -j$(nproc --all)
- name: Upload to Release
uses: softprops/action-gh-release@v1
with:
files: |
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.zip
workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/boot.img
name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }}
tag_name: ${{ github.run_id }}
body: Recovery for ${{ github.event.inputs.DEVICE_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.work }}