forked from SchweGELBin/action_kernel_milk_davinci
-
Notifications
You must be signed in to change notification settings - Fork 5
executable file
·140 lines (131 loc) · 4.27 KB
/
build.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
name: CI Build
on:
workflow_dispatch:
inputs:
Build_Kernel:
required: true
type: choice
default: KSU & NonKSU
options:
- KSU
- NonKSU
- KSU & NonKSU
KSU_Manager_Non_GKI:
required: true
type: boolean
default: false
Kernel_Git:
required: true
type: string
default: https://github.com/silvzr/bootlegger_kernel_archive.git
Kernel_Branch:
required: true
type: string
default: pos14
AnyKernel3_Git:
required: true
type: string
default: https://github.com/silvzr/AnyKernel3.git
Device_Code:
required: true
type: string
default: davinci
Device_Defconfig:
required: true
type: string
default: davinci_defconfig
Common_Defconfig:
required: false
type: string
os:
required: true
type: string
default: ubuntu-latest
jobs:
build-ksu-manager:
if: ${{ inputs.KSU_Manager_Non_GKI }}
uses: ./.github/workflows/build-ksu-manager.yml
with:
os: ${{ inputs.os }}
build-ksu:
needs: [build-ksu-manager]
if: ${{ (inputs.Build_Kernel == 'KSU' || inputs.Build_Kernel == 'KSU & NonKSU') && !failure() && !cancelled() }}
uses: ./.github/workflows/build-kernel.yml
with:
include_ksu: "KSU"
include_ksu_manager: ${{ inputs.KSU_Manager_Non_GKI }}
kernel_git: ${{ inputs.Kernel_Git }}
kernel_branch: ${{ inputs.Kernel_Branch }}
anykernel3_git: ${{ inputs.AnyKernel3_Git }}
device_code: ${{ inputs.Device_Code }}
device_defconfig: ${{ inputs.Device_Defconfig }}
common_defconfig: ${{ inputs.Common_Defconfig }}
os: ${{ inputs.os }}
build-nonksu:
if: ${{ inputs.Build_Kernel == 'NonKSU' || inputs.Build_Kernel == 'KSU & NonKSU' }}
uses: ./.github/workflows/build-kernel.yml
with:
include_ksu: "NonKSU"
include_ksu_manager: "false"
kernel_git: ${{ inputs.Kernel_Git }}
kernel_branch: ${{ inputs.Kernel_Branch }}
anykernel3_git: ${{ inputs.AnyKernel3_Git }}
device_code: ${{ inputs.Device_Code }}
device_defconfig: ${{ inputs.Device_Defconfig }}
common_defconfig: ${{ inputs.Common_Defconfig }}
os: ${{ inputs.os }}
release:
needs: [build-ksu-manager, build-ksu, build-nonksu]
if: |
always() &&
!failure() &&
!cancelled()
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Tag
id: tag
run: |
latest_tag=$(curl -s https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | grep "tag_name" | cut -d '"' -f 4)
if [[ -z "$latest_tag" ]]; then latest_tag='v0'; fi
echo "Latest Tag: $latest_tag"
echo "tag=v$((${latest_tag:1} + 1))" >> $GITHUB_ENV
- name: Download artifacts
id: artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: false
path: out/download/.
- name: Prepare Release
id: prepare
run: |
cd $GITHUB_WORKSPACE
mkdir -p out/artifacts
if [[ $(ls out/download | grep "\-KSU") ]]; then
cp out/download/*-KSU/bodyFile.md out/bodyFile.md
echo "name=$(cat out/download/*-KSU/name.txt)" >> $GITHUB_ENV
else
cp out/download/*-NonKSU/bodyFile.md out/bodyFile.md
echo "name=$(cat out/download/*-NonKSU/name.txt)" >> $GITHUB_ENV
fi
if [[ $(ls out/download | grep "manager") ]]; then
cp out/download/manager/*.apk out/artifacts/Manager.apk
fi
cp out/download/*KSU/*.zip out/artifacts/
- name: Release
id: release
uses: ncipollo/release-action@v1
with:
name: "${{ env.name }}-${{ env.tag }}"
tag: "${{ env.tag }}"
allowUpdates: false
bodyFile: "${{ github.workspace }}/out/bodyFile.md"
artifacts: "${{ github.workspace }}/out/artifacts/*"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup
id: cleanup
run: rm -r $GITHUB_WORKSPACE/out/*