-
Notifications
You must be signed in to change notification settings - Fork 38
174 lines (153 loc) · 5.26 KB
/
PBRP-new.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
168
169
170
171
172
173
174
name: PitchBlack Recovery Project Builder
on:
workflow_dispatch:
inputs:
MANIFEST_BRANCH:
description: 'PBRP Manifest Branch'
required: true
default: 'android-12.1'
type: choice
options:
- android-14.0
- android-12.1
- android-11.0
- android-10.0
- android-9.0
- android-8.1
- android-7.1
- android-6.0
DEVICE_TREE:
description: 'Custom Recovery Tree URL'
required: true
default: 'https://github.com/enter_username/repo_name'
DEVICE_TREE_BRANCH:
description: 'Device Tree Branch'
required: true
default: 'main'
DEVICE_NAME:
description: 'Device Codename'
required: true
DEVICE_PATH:
description: 'Device Path (from BoardConfig.mk)'
required: true
default: 'device/manufacturer/codename'
BUILD_TARGET:
description: 'Build Target (use "pbrp" for Android 11+)'
required: true
default: 'recovery'
type: choice
options:
- pbrp
- recovery
- boot
- vendorboot
LDCHECK:
description: 'Run dependency check'
required: false
default: false
type: boolean
LDCHECKPATH:
description: 'Path for dependency check'
required: true
default: 'recovery/root/system/bin/qseecomd'
jobs:
build:
name: Build PBRP by ${{ github.actor }}
runs-on: ubuntu-latest
if: github.event.repository.owner.id == github.event.sender.id
env:
OUTPUT_DIR: ${{ github.workspace }}/android-recovery/out/target/product/${{ inputs.DEVICE_NAME }}
DEBIAN_FRONTEND: noninteractive
permissions:
contents: write
steps:
- name: Initial Setup
run: |
echo "BUILD_START=$(date +%s)" >> $GITHUB_ENV
echo "BUILD_DATE=$(TZ=UTC date +%Y%m%d)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Clean-up
uses: rokibhasansagar/slimhub_actions@main
- name: Swap Space # Easier
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 24
- name: Build PitchBlack Recovery
uses: mlm-games/pitchblack-pbrp-builder-action@main
id: build
with:
MANIFEST_BRANCH: 'android-12.1'
DEVICE_TREE: 'https://github.com/mlm-games/twrp_galaxy_m02s'
DEVICE_TREE_BRANCH: 'pbrp'
BUILD_TARGET: 'pbrp'
- name: Upload Artifacts
uses: actions/upload-artifact@v4
if: inputs.upload_releases == false || github.event_name != 'workflow_dispatch'
with:
name: TWRP-Recovery-${{ env.DEVICE_NAME }}-${{ env.COMMIT_SHORT }}
path: |
${{ env.OUTPUT_DIR }}/*.img
${{ env.OUTPUT_DIR }}/*.tar
${{ env.OUTPUT_DIR }}/*vbmeta*
${{ env.OUTPUT_DIR }}/*.cpio
- name: Upload to Release
if: success()
uses: softprops/action-gh-release@master
with:
files: |
${{ env.OUTPUT_DIR }}/*.img
${{ env.OUTPUT_DIR }}/PBRP*.zip
${{ env.OUTPUT_DIR }}/ramdisk-recovery.*
name: PBRP for ${{ inputs.DEVICE_NAME }} - ${{ env.BUILD_DATE }}
tag_name: ${{ github.run_id }}
body: |
## Build Information
- **Build Date:** ${{ env.BUILD_DATE }}
- **Branch:** ${{ inputs.MANIFEST_BRANCH }}
- **Device:** ${{ inputs.DEVICE_NAME }}
- **Build Type:** ${{ inputs.BUILD_TARGET }}
## Source Information
- **Device Tree:** [${{ inputs.DEVICE_TREE }}](${{ inputs.DEVICE_TREE }}/tree/${{ inputs.DEVICE_TREE_BRANCH }})
- **Branch:** ${{ inputs.DEVICE_TREE_BRANCH }}
- **Commit:** [${{ env.COMMIT_ID }}](${{ inputs.DEVICE_TREE }}/commit/${{ env.COMMIT_ID }})
## Build Status
- Recovery Image MD5: `${{ env.MD5_IMG }}`
- ZIP Package MD5: `${{ env.MD5_ZIP }}`
> Note: This is an automated build. Please test thoroughly before using.
prerelease: true
draft: false
- name: Run LDCHECK
uses: mlm-games/ldcheck-action@main
with:
OUTPUT_DIR: ${{ env.OUTPUT_DIR }}
LDCHECKPATH: ${{ inputs.LDCHECK_PATH }}
- name: Calculate Build Time
if: always()
run: |
BUILD_END=$(date +%s)
BUILD_DURATION=$((BUILD_END - BUILD_START))
hours=$((BUILD_DURATION / 3600))
minutes=$(((BUILD_DURATION % 3600) / 60))
seconds=$((BUILD_DURATION % 60))
echo "Build completed in ${hours}h ${minutes}m ${seconds}s"
# Save build statistics
echo "BUILD_DURATION=${BUILD_DURATION}" >> $GITHUB_ENV
echo "BUILD_HOURS=${hours}" >> $GITHUB_ENV
echo "BUILD_MINUTES=${minutes}" >> $GITHUB_ENV
echo "BUILD_SECONDS=${seconds}" >> $GITHUB_ENV
- name: Upload Build Logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: build-logs-${{ inputs.DEVICE_NAME }}-${{ env.BUILD_DATE }}
path: |
${{ env.OUTPUT_DIR }}/*.log
${{ env.OUTPUT_DIR }}/log
retention-days: 5
- name: Cleanup Workspace
if: always()
run: |
cd ${{ github.workspace }}
rm -rf android-recovery
df -h