forked from byf3332/Lazy_Action-Recoverys-Builder
-
Notifications
You must be signed in to change notification settings - Fork 7
167 lines (151 loc) · 6.66 KB
/
OrangeFox [OFRP].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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: OrangeFox [OFRP]
on:
workflow_dispatch:
inputs:
SYNC_URL:
description: 'SYNC_URL'
required: true
default: 'https://github.com/momo54181/ofrp-sync.git'
MANIFEST_BRANCH:
description: 'MANIFEST_BRANCH'
required: true
default: '10.0'
DEVICE_TREE_URL:
description: 'DEVICE_TREE_URL'
required: true
default: 'https://github.com/momo54181/android_device_oppo_PACM00'
DEVICE_TREE_BRANCH:
description: 'DEVICE_TREE_BRANCH'
required: true
default: 'android-10'
DEVICE_PATH:
description: 'DEVICE_PATH'
required: true
default: 'device/oppo/PACM00'
COMMON_TREE_URL:
description: 'COMMON_TREE_URL (if no common tree, leave blank)'
required: false
COMMON_PATH:
description: 'COMMON_PATH (if no common tree, leave blank)'
required: false
DEVICE_NAME:
description: 'DEVICE_NAME'
required: true
default: 'PACM00'
MAKEFILE_NAME:
description: 'MAKEFILE_NAME'
required: true
default: 'omni_PACM00'
BUILD_TARGET:
description: 'BUILD_TARGET'
required: true
default: 'recovery'
jobs:
build:
if: github.event.repository.owner.id == github.event.sender.id
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
# You might want to Checkout your repo first, but not mandatory
- name: Check Out
uses: actions/checkout@v3
# Cleanup The Actions Workspace Using Custom Composite Run Actions
- name: Cleanup
uses: rokibhasansagar/slimhub_actions@main
- name: Initialize workspace
run: |
mkdir workspace
cd workspace
echo "workspace-folder=$(pwd)" >> $GITHUB_OUTPUT
id: pwd
- name: Prepare the build environment
run: |
sudo apt install git aria2 -y
git clone https://gitlab.com/OrangeFox/misc/scripts
cd scripts
sudo bash setup/android_build_env.sh
<<<<<<< HEAD
- name: Set-up Manifest
run: |
mkdir -p ${GITHUB_WORKSPACE}/OrangeFox
cd ${GITHUB_WORKSPACE}/OrangeFox
git config --global user.name "lazycodebuilder"
git config --global user.email "[email protected]"
git clone https://github.com/momo54181/ofrp-sync.git
if [ ${{ inputs.MANIFEST_BRANCH }} == '11.0' ] || [ ${{ inputs.MANIFEST_BRANCH }} == '12.1' ]; then
echo "Sync fox_${{ inputs.MANIFEST_BRANCH }} branch"
echo "CHECK_LEGACY_BRANCH=false" >> $GITHUB_ENV
cd ofrp-sync
chmod 777 orangefox_sync.sh
./orangefox_sync.sh --branch ${{ inputs.MANIFEST_BRANCH }} --path ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ inputs.MANIFEST_BRANCH }}
else
echo "Sync legacy fox_${{ inputs.MANIFEST_BRANCH }} branch"
echo "CHECK_LEGACY_BRANCH=true" >> $GITHUB_ENV
cd ofrp-sync
chmod 777 orangefox_sync.sh
./orangefox_sync.sh --branch ${{ inputs.MANIFEST_BRANCH }} --path ${GITHUB_WORKSPACE}/OrangeFox/fox_${{ inputs.MANIFEST_BRANCH }}
fi
=======
sed -i 's/cd -/cd ../g' setup/install_android_sdk.sh
sudo bash setup/install_android_sdk.sh
working-directory: ${{ steps.pwd.outputs.workspace-folder }}
>>>>>>> parent of 8ccc3cb (Update OrangeFox [OFRP].yml)
- name: Sync OrangeFox sources and minimal manifest
run: |
cd ${{ steps.pwd.outputs.workspace-folder }}
git clone ${{ github.event.inputs.SYNC_URL }}
cd sync
chmod 777 orangefox_sync.sh
./orangefox_sync.sh --branch ${{ github.event.inputs.MANIFEST_BRANCH }} --path ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
working-directory: ${{ steps.pwd.outputs.workspace-folder }}
- name: Clone device tree
run: |
cd ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
git clone ${{ github.event.inputs.DEVICE_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }}
working-directory: ${{ steps.pwd.outputs.workspace-folder }}
- name: Clone common tree
if: |
github.event.inputs.COMMON_TREE_URL != null
&& github.event.inputs.COMMON_PATH != null
run: |
cd ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
git clone ${{ github.event.inputs.COMMON_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.COMMON_PATH }}
working-directory: ${{ steps.pwd.outputs.workspace-folder }}
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 12
- name: install py-is-py2
run: sudo apt-get install python-is-python2
- name: Building recovery
run: |
cd ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}
set +e
source build/envsetup.sh
export FOX_USE_TWRP_RECOVERY_IMAGE_BUILDER=1
export ALLOW_MISSING_DEPENDENCIES=true
set -e
lunch ${{ github.event.inputs.MAKEFILE_NAME }}-eng && make clean && mka adbd ${{ github.event.inputs.BUILD_TARGET }}image -j$(nproc --all)
working-directory: ${{ steps.pwd.outputs.workspace-folder }}
continue-on-error: true
- name: Check the output directory before uploading
run: |
ls -al ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/
echo
ls -al ${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/
- name: Upload to Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.img
${{ steps.pwd.outputs.workspace-folder }}/fox_${{ github.event.inputs.MANIFEST_BRANCH }}/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.zip
name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }}
tag_name: ${{ github.run_id }}
body: |
Manifest: ${{ github.event.inputs.MANIFEST_BRANCH }}
Device: ${{ github.event.inputs.DEVICE_NAME }}
Target: ${{ github.event.inputs.BUILD_TARGET }}.img
TREE: [Device Tree/Branch](${{ github.event.inputs.DEVICE_TREE_URL }}/tree/${{ github.event.inputs.DEVICE_TREE_BRANCH }})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}