Skip to content

Commit cb25ff7

Browse files
authored
Update build-kernel.yml
1 parent ecc56ca commit cb25ff7

File tree

1 file changed

+19
-32
lines changed

1 file changed

+19
-32
lines changed

.github/workflows/build-kernel.yml

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,86 +13,73 @@ on:
1313
- full
1414
build_android_12:
1515
description: 'Build Android 12 GKI Kernel?'
16-
required: false
17-
default: true
16+
required: false # User interaction is optional
17+
default: true # Defaults to building Android 12
1818
type: boolean
1919
build_android_13:
2020
description: 'Build Android 13 GKI Kernel?'
21-
required: false
22-
default: true
21+
required: false # User interaction is optional
22+
default: true # Defaults to building Android 13
2323
type: boolean
2424
build_android_14:
2525
description: 'Build Android 14 GKI Kernel?'
26-
required: false
27-
default: true
26+
required: false # User interaction is optional
27+
default: true # Defaults to building Android 14
2828
type: boolean
2929
make_release:
3030
description: 'Trigger release after the build?'
31-
required: false
32-
default: true
31+
required: false # User interaction is optional
32+
default: true # Defaults to not triggering a release
3333
type: boolean
3434

35+
# Trigger when there is a push to the 'main' branch
3536
push:
3637
branches:
37-
- main # Trigger on push to the main branch
38+
- main
3839

3940
jobs:
40-
# Set default values if no input is provided (for push event)
41-
set-default-values:
42-
runs-on: ubuntu-latest
43-
steps:
44-
- name: Set default values
45-
run: |
46-
echo "LTO_TYPE=${{ github.event.inputs.lto_type || 'thin' }}" >> $GITHUB_ENV
47-
echo "BUILD_ANDROID_12=${{ github.event.inputs.build_android_12 || 'true' }}" >> $GITHUB_ENV
48-
echo "BUILD_ANDROID_13=${{ github.event.inputs.build_android_13 || 'true' }}" >> $GITHUB_ENV
49-
echo "BUILD_ANDROID_14=${{ github.event.inputs.build_android_14 || 'true' }}" >> $GITHUB_ENV
50-
echo "MAKE_RELEASE=${{ github.event.inputs.make_release || 'true' }}" >> $GITHUB_ENV
51-
5241
# Validation Step
5342
validate-inputs:
5443
runs-on: ubuntu-latest
55-
needs: set-default-values
5644
steps:
5745
- name: Validate Inputs
5846
run: |
59-
if [ "${{ env.BUILD_ANDROID_12 }}" != "true" ] && [ "${{ env.BUILD_ANDROID_13 }}" != "true" ] && [ "${{ env.BUILD_ANDROID_14 }}" != "true" ]; then
47+
if [ "${{ inputs.build_android_12 }}" != true ] && [ "${{ inputs.build_android_13 }}" != true ] && [ "${{ inputs.build_android_14 }}" != true ]; then
6048
echo "At least one kernel build must be selected!"
6149
exit 1
62-
fi
63-
50+
6451
# Build Android 12 GKI Kernel
6552
build-kernel-a12:
66-
if: ${{ env.BUILD_ANDROID_12 == 'true' }}
53+
if: inputs.build_android_12 == true
6754
needs: validate-inputs
6855
uses: ./.github/workflows/build-kernel-a12.yml
6956
with:
70-
lto_type: ${{ env.LTO_TYPE }}
57+
lto_type: ${{ inputs.lto_type }}
7158
secrets: inherit
7259

7360
# Build Android 13 GKI Kernel
7461
build-kernel-a13:
75-
if: ${{ env.BUILD_ANDROID_13 == 'true' }}
62+
if: inputs.build_android_13 == true
7663
needs: validate-inputs
7764
uses: ./.github/workflows/build-kernel-a13.yml
7865
with:
79-
lto_type: ${{ env.LTO_TYPE }}
66+
lto_type: ${{ inputs.lto_type }}
8067
secrets: inherit
8168

8269
# Build Android 14 GKI Kernel
8370
build-kernel-a14:
84-
if: ${{ env.BUILD_ANDROID_14 == 'true' }}
71+
if: inputs.build_android_14 == true
8572
needs: validate-inputs
8673
uses: ./.github/workflows/build-kernel-a14.yml
8774
with:
88-
lto_type: ${{ env.LTO_TYPE }}
75+
lto_type: ${{ inputs.lto_type }}
8976
secrets: inherit
9077

9178
# Trigger Release Job
9279
trigger-release:
9380
runs-on: ubuntu-latest
9481
needs: [build-kernel-a12, build-kernel-a13, build-kernel-a14]
95-
if: ${{ env.MAKE_RELEASE == 'true' }} # Trigger release only if make_release is true
82+
if: inputs.make_release == true # Trigger release only if make_release is true
9683
steps:
9784
- name: Checkout code
9885
uses: actions/checkout@v2

0 commit comments

Comments
 (0)