Skip to content

Commit d9569de

Browse files
authored
Update build-kernel.yml
1 parent feee862 commit d9569de

File tree

1 file changed

+38
-16
lines changed

1 file changed

+38
-16
lines changed

.github/workflows/build-kernel.yml

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
workflow_dispatch:
87
inputs:
98
lto_type:
109
description: 'Choose LTO type (thin/full)'
@@ -35,30 +34,53 @@ on:
3534
default: false # Default to not triggering a release
3635
type: boolean
3736

37+
workflow_dispatch:
38+
inputs:
39+
lto_type:
40+
description: 'Choose LTO type (thin/full)'
41+
required: true
42+
default: 'full' # Default to 'thin' LTO
43+
type: choice
44+
options:
45+
- thin
46+
- full
47+
build_android_12:
48+
description: 'Build Android 12 GKI Kernel?'
49+
required: false # User interaction is optional
50+
default: true # Defaults to building Android 12
51+
type: boolean
52+
build_android_13:
53+
description: 'Build Android 13 GKI Kernel?'
54+
required: false # User interaction is optional
55+
default: true # Defaults to building Android 13
56+
type: boolean
57+
build_android_14:
58+
description: 'Build Android 14 GKI Kernel?'
59+
required: false # User interaction is optional
60+
default: true # Defaults to building Android 14
61+
type: boolean
62+
make_release:
63+
description: 'Trigger release after the build?'
64+
required: false # User interaction is optional
65+
default: true # Default to not triggering a release
66+
type: boolean
67+
3868
jobs:
3969
# Validation Step
4070
validate-inputs:
4171
runs-on: ubuntu-latest
4272
timeout-minutes: 360
4373
steps:
44-
- name: Set default values if inputs are missing
74+
- name: Validate Inputs
4575
run: |
46-
if [ -z "${{ inputs.build_android_12 }}" ]; then
47-
echo "build_android_12=true" >> $GITHUB_ENV
48-
fi
49-
if [ -z "${{ inputs.build_android_13 }}" ]; then
50-
echo "build_android_13=true" >> $GITHUB_ENV
51-
fi
52-
if [ -z "${{ inputs.build_android_14 }}" ]; then
53-
echo "build_android_14=true" >> $GITHUB_ENV
54-
fi
55-
if [ -z "${{ inputs.make_release }}" ]; then
56-
echo "make_release=false" >> $GITHUB_ENV
76+
if [ "${{ inputs.build_android_12 }}" != true ] && [ "${{ inputs.build_android_13 }}" != true ] && [ "${{ inputs.build_android_14 }}" != true ]; then
77+
echo "At least one kernel build must be selected!"
78+
exit 1
5779
fi
5880
5981
# Build Android 12 GKI Kernel
6082
build-kernel-a12:
61-
if: ${{ env.build_android_12 == 'true' }}
83+
if: ${{ inputs.build_android_12 == true }}
6284
needs: validate-inputs
6385
uses: ./.github/workflows/build-kernel-a12.yml
6486
with:
@@ -67,7 +89,7 @@ jobs:
6789

6890
# Build Android 13 GKI Kernel
6991
build-kernel-a13:
70-
if: ${{ env.build_android_13 == 'true' }}
92+
if: ${{ inputs.build_android_13 == true }}
7193
needs: validate-inputs
7294
uses: ./.github/workflows/build-kernel-a13.yml
7395
with:
@@ -76,7 +98,7 @@ jobs:
7698

7799
# Build Android 14 GKI Kernel
78100
build-kernel-a14:
79-
if: ${{ env.build_android_14 == 'true' }}
101+
if: ${{ inputs.build_android_14 == true }}
80102
needs: validate-inputs
81103
uses: ./.github/workflows/build-kernel-a14.yml
82104
with:

0 commit comments

Comments
 (0)