Skip to content

Commit d656737

Browse files
authored
Update build-kernel.yml
1 parent 30c41e0 commit d656737

File tree

1 file changed

+21
-31
lines changed

1 file changed

+21
-31
lines changed

.github/workflows/build-kernel.yml

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

3535
push:
@@ -43,21 +43,11 @@ jobs:
4343
steps:
4444
- name: Set default values
4545
run: |
46-
if [ -z "${{ github.event.inputs.lto_type }}" ]; then
47-
echo "lto_type=thin" >> $GITHUB_ENV
48-
fi
49-
if [ -z "${{ github.event.inputs.build_android_12 }}" ]; then
50-
echo "build_android_12=true" >> $GITHUB_ENV
51-
fi
52-
if [ -z "${{ github.event.inputs.build_android_13 }}" ]; then
53-
echo "build_android_13=true" >> $GITHUB_ENV
54-
fi
55-
if [ -z "${{ github.event.inputs.build_android_14 }}" ]; then
56-
echo "build_android_14=true" >> $GITHUB_ENV
57-
fi
58-
if [ -z "${{ github.event.inputs.make_release }}" ]; then
59-
echo "make_release=true" >> $GITHUB_ENV
60-
fi
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
6151
6252
# Validation Step
6353
validate-inputs:
@@ -66,43 +56,43 @@ jobs:
6656
steps:
6757
- name: Validate Inputs
6858
run: |
69-
if [ "${{ env.build_android_12 }}" != true ] && [ "${{ env.build_android_13 }}" != true ] && [ "${{ env.build_android_14 }}" != true ]; then
59+
if [ "${{ env.BUILD_ANDROID_12 }}" != "true" ] && [ "${{ env.BUILD_ANDROID_13 }}" != "true" ] && [ "${{ env.BUILD_ANDROID_14 }}" != "true" ]; then
7060
echo "At least one kernel build must be selected!"
7161
exit 1
7262
fi
7363
7464
# Build Android 12 GKI Kernel
7565
build-kernel-a12:
76-
if: ${{ env.build_android_12 == 'true' }}
66+
if: ${{ env.BUILD_ANDROID_12 == 'true' }}
7767
needs: validate-inputs
7868
uses: ./.github/workflows/build-kernel-a12.yml
7969
with:
80-
lto_type: ${{ env.lto_type }}
70+
lto_type: ${{ env.LTO_TYPE }}
8171
secrets: inherit
8272

8373
# Build Android 13 GKI Kernel
8474
build-kernel-a13:
85-
if: ${{ env.build_android_13 == 'true' }}
75+
if: ${{ env.BUILD_ANDROID_13 == 'true' }}
8676
needs: validate-inputs
8777
uses: ./.github/workflows/build-kernel-a13.yml
8878
with:
89-
lto_type: ${{ env.lto_type }}
79+
lto_type: ${{ env.LTO_TYPE }}
9080
secrets: inherit
9181

9282
# Build Android 14 GKI Kernel
9383
build-kernel-a14:
94-
if: ${{ env.build_android_14 == 'true' }}
84+
if: ${{ env.BUILD_ANDROID_14 == 'true' }}
9585
needs: validate-inputs
9686
uses: ./.github/workflows/build-kernel-a14.yml
9787
with:
98-
lto_type: ${{ env.lto_type }}
88+
lto_type: ${{ env.LTO_TYPE }}
9989
secrets: inherit
10090

10191
# Trigger Release Job
10292
trigger-release:
10393
runs-on: ubuntu-latest
10494
needs: [build-kernel-a12, build-kernel-a13, build-kernel-a14]
105-
if: ${{ env.make_release == 'true' }} # Trigger release only if make_release is true
95+
if: ${{ env.MAKE_RELEASE == 'true' }} # Trigger release only if make_release is true
10696
steps:
10797
- name: Checkout code
10898
uses: actions/checkout@v2

0 commit comments

Comments
 (0)