Skip to content

Commit 24eee91

Browse files
Update build-kernel-release.yml
1 parent 39264f1 commit 24eee91

File tree

1 file changed

+77
-75
lines changed

1 file changed

+77
-75
lines changed

.github/workflows/build-kernel-release.yml

Lines changed: 77 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,28 @@ on:
4343
description: 'Clean build (no ccache)'
4444
type: boolean
4545
default: false
46-
susfs_config:
47-
description: 'SUSFS config (JSON format, blank=all "next". Examples in README)'
46+
android12-5_10_susfs_branch_or_commit:
47+
description: 'Enter SusFS Branch or commit hash for android12-5.10'
48+
type: string
49+
default: ''
50+
android13-5_10_susfs_branch_or_commit:
51+
description: 'Enter SusFS Branch or commit hash for android13-5.10'
52+
type: string
53+
default: ''
54+
android13-5_15_susfs_branch_or_commit:
55+
description: 'Enter SusFS Branch or commit hash for android13-5.15'
56+
type: string
57+
default: ''
58+
android14-5_15_susfs_branch_or_commit:
59+
description: 'Enter SusFS Branch or commit hash for android14-5.15'
60+
type: string
61+
default: ''
62+
android14-6_1_susfs_branch_or_commit:
63+
description: 'Enter SusFS Branch or commit hash for android14-6.1'
64+
type: string
65+
default: ''
66+
android15-6_6_susfs_branch_or_commit:
67+
description: 'Enter SusFS Branch or commit hash for android15-6.6'
4868
type: string
4969
default: ''
5070

@@ -54,7 +74,6 @@ jobs:
5474
outputs:
5575
matrix: ${{ steps.set-matrix.outputs.matrix }}
5676
device_count: ${{ steps.set-matrix.outputs.count }}
57-
susfs_map: ${{ steps.parse-susfs.outputs.susfs_map }}
5877
steps:
5978
- name: 📥 Checkout Code (to access configs/)
6079
uses: actions/checkout@v4
@@ -63,59 +82,6 @@ jobs:
6382
configs/
6483
sparse-checkout-cone-mode: false
6584

66-
- name: 🔍 Parse SUSFS Configuration
67-
id: parse-susfs
68-
shell: bash
69-
run: |
70-
set -euo pipefail
71-
72-
echo "::group::SUSFS Configuration"
73-
74-
DEFAULT_SUSFS='{
75-
"android12-5.10": "next",
76-
"android13-5.10": "next",
77-
"android13-5.15": "next",
78-
"android14-5.15": "next",
79-
"android14-6.1": "next",
80-
"android15-6.6": "next"
81-
}'
82-
83-
INPUT='${{ inputs.susfs_config }}'
84-
85-
if [ -z "$INPUT" ] || [ "$INPUT" = "{}" ]; then
86-
echo "ℹ️ Using default SUSFS configuration (all 'next' = auto-select gki branches)"
87-
SUSFS_MAP="$DEFAULT_SUSFS"
88-
else
89-
echo "🔧 Parsing custom SUSFS configuration..."
90-
91-
if ! echo "$INPUT" | jq empty 2>/dev/null; then
92-
echo "::error::Invalid JSON in susfs_config input"
93-
exit 1
94-
fi
95-
96-
SUSFS_MAP=$(jq -n \
97-
--argjson defaults "$DEFAULT_SUSFS" \
98-
--argjson input "$INPUT" \
99-
'$defaults * $input')
100-
101-
echo "✅ Custom SUSFS configuration applied"
102-
fi
103-
104-
echo ""
105-
echo "📋 Final SUSFS Configuration:"
106-
echo "$SUSFS_MAP" | jq -r 'to_entries[] |
107-
if .value == "next" then
108-
" - \(.key): next (will auto-select gki-\(.key))"
109-
else
110-
" - \(.key): \(.value)"
111-
end'
112-
113-
echo "susfs_map<<SUSFS_EOF" >> "$GITHUB_OUTPUT"
114-
echo "$SUSFS_MAP" >> "$GITHUB_OUTPUT"
115-
echo "SUSFS_EOF" >> "$GITHUB_OUTPUT"
116-
117-
echo "::endgroup::"
118-
11985
- name: 🔍 Generate build matrix
12086
id: set-matrix
12187
shell: bash
@@ -209,22 +175,33 @@ jobs:
209175
| Create Release | ${{ inputs.make_release }} |
210176
211177
### SUSFS Configuration
178+
| Kernel Version | SUSFS Branch/Commit |
179+
|----------------|---------------------|
212180
EOF
213181
214-
echo '${{ steps.parse-susfs.outputs.susfs_map }}' | jq -r '
215-
"| Kernel Version | SUSFS Branch |",
216-
"|----------------|--------------|",
217-
(to_entries[] |
218-
if .value == "next" then
219-
"| \(.key) | `next` (→ gki-\(.key)) |"
220-
else
221-
"| \(.key) | `\(.value)` |"
222-
end
223-
)
224-
' >> $GITHUB_STEP_SUMMARY
182+
# Display SUSFS config for each kernel version
183+
for key in "android12-5.10" "android13-5.10" "android13-5.15" "android14-5.15" "android14-6.1" "android15-6.6"; do
184+
input_key=$(echo "$key" | tr '.-' '__')
185+
input_name="android${key#android}_susfs_branch_or_commit"
186+
187+
case "$key" in
188+
"android12-5.10") value="${{ inputs.android12-5_10_susfs_branch_or_commit }}" ;;
189+
"android13-5.10") value="${{ inputs.android13-5_10_susfs_branch_or_commit }}" ;;
190+
"android13-5.15") value="${{ inputs.android13-5_15_susfs_branch_or_commit }}" ;;
191+
"android14-5.15") value="${{ inputs.android14-5_15_susfs_branch_or_commit }}" ;;
192+
"android14-6.1") value="${{ inputs.android14-6_1_susfs_branch_or_commit }}" ;;
193+
"android15-6.6") value="${{ inputs.android15-6_6_susfs_branch_or_commit }}" ;;
194+
esac
195+
196+
if [ -z "$value" ]; then
197+
echo "| $key | \`(auto: gki-$key)\` |" >> $GITHUB_STEP_SUMMARY
198+
else
199+
echo "| $key | \`$value\` |" >> $GITHUB_STEP_SUMMARY
200+
fi
201+
done
225202
226203
echo "" >> $GITHUB_STEP_SUMMARY
227-
echo "> **Note:** \`next\` auto-maps to the matching gki-androidX-Y.Z branch during build." >> $GITHUB_STEP_SUMMARY
204+
echo "> **Note:** Empty values auto-map to the matching gki-androidX-Y.Z branch during build." >> $GITHUB_STEP_SUMMARY
228205
229206
build:
230207
name: build (${{ matrix.model }}, ${{ matrix.soc }}, ${{ matrix.branch }}, ${{ matrix.manifest }}, ${{ matrix.android_version }}, ${{ matrix.kernel_version }}, ${{ matrix.os_version }}, ${{ inputs.ksun_branch }})
@@ -257,25 +234,50 @@ jobs:
257234
echo "✅ Available space: $AVAIL"
258235
echo "::endgroup::"
259236
260-
- name: 🔍 Resolve SUSFS branch from config
237+
- name: 🔍 Resolve SUSFS branch from inputs
261238
id: susfs
262239
shell: bash
263240
run: |
264241
set -euo pipefail
265242
266243
key="${{ matrix.android_version }}-${{ matrix.kernel_version }}"
267-
SUSFS_MAP='${{ needs.set-op-model.outputs.susfs_map }}'
268244
269245
echo "Looking up SUSFS branch for: $key"
270246
271-
susfs_branch=$(echo "$SUSFS_MAP" | jq -r --arg key "$key" '.[$key] // "next"')
247+
# Map kernel version to input value
248+
case "$key" in
249+
"android12-5.10")
250+
susfs_branch="${{ inputs.android12-5_10_susfs_branch_or_commit }}"
251+
;;
252+
"android13-5.10")
253+
susfs_branch="${{ inputs.android13-5_10_susfs_branch_or_commit }}"
254+
;;
255+
"android13-5.15")
256+
susfs_branch="${{ inputs.android13-5_15_susfs_branch_or_commit }}"
257+
;;
258+
"android14-5.15")
259+
susfs_branch="${{ inputs.android14-5_15_susfs_branch_or_commit }}"
260+
;;
261+
"android14-6.1")
262+
susfs_branch="${{ inputs.android14-6_1_susfs_branch_or_commit }}"
263+
;;
264+
"android15-6.6")
265+
susfs_branch="${{ inputs.android15-6_6_susfs_branch_or_commit }}"
266+
;;
267+
*)
268+
echo "::error::Unsupported kernel version: $key"
269+
exit 1
270+
;;
271+
esac
272272
273+
# If empty, it will be auto-resolved to gki-* branch in the action
273274
if [ -z "$susfs_branch" ]; then
274-
echo "::warning::No SUSFS branch found for $key, using 'next'"
275-
susfs_branch="next"
275+
echo "ℹ️ No custom SUSFS branch specified for $key"
276+
echo " Will auto-select: gki-$key"
277+
else
278+
echo "✅ Using custom SUSFS branch for $key: '$susfs_branch'"
276279
fi
277280
278-
echo "✅ SUSFS branch for $key: '$susfs_branch'"
279281
echo "susfs_branch=$susfs_branch" >> "$GITHUB_OUTPUT"
280282
281283
- name: 📥 Checkout Code
@@ -356,7 +358,7 @@ jobs:
356358
### ${{ matrix.model }} - ${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}
357359
358360
**Kernel:** ${{ matrix.android_version }}-${{ matrix.kernel_version }}
359-
**SUSFS Branch:** \`${{ steps.susfs.outputs.susfs_branch }}\`
361+
**SUSFS Branch:** \`${{ steps.susfs.outputs.susfs_branch || format('(auto: gki-{0}-{1})', matrix.android_version, matrix.kernel_version) }}\`
360362
361363
EOF
362364

0 commit comments

Comments
 (0)