14
14
description : ' Use latest release artifacts instead of workflow artifacts'
15
15
type : boolean
16
16
default : false
17
-
17
+ pull_request :
18
+ types : [labeled]
18
19
jobs :
19
20
create-image :
20
21
name : Create SD Card Image for ${{ inputs.board }}
21
22
runs-on : ubuntu-latest
23
+ # runs-on: [ self-hosted, latest ]
22
24
steps :
23
25
- name : Checkout repository
24
26
uses : actions/checkout@v4
25
27
with :
26
28
clean : true
27
- fetch-depth : 1
29
+ fetch-depth : 0
28
30
submodules : recursive
29
31
30
32
- name : Install dependencies
38
40
qemu-utils \
39
41
dosfstools \
40
42
e2fsprogs \
43
+ genext2fs \
44
+ mtools \
41
45
jq
42
46
43
47
- name : Prepare build environment
48
52
49
53
- name : Set bootloader and target based on board
50
54
run : |
51
- case "${{ inputs.board }}" in
55
+ #case "${{ inputs.board }}" in
56
+ case "raspberry-pi-4" in
52
57
raspberry-pi-4)
53
58
echo "BOOTLOADER=rpi4_boot" >> $GITHUB_ENV
54
59
echo "TARGET=aarch64" >> $GITHUB_ENV
@@ -64,17 +69,18 @@ jobs:
64
69
if : ${{ !inputs.use_latest_release }}
65
70
run : |
66
71
# Download from latest bootloader build workflow on main branch
67
- gh run list --workflow=build-boot.yml --branch=main --limit=1 --status=success --json databaseId --jq '.[0].databaseId' > latest_boot_run_id
72
+ #gh run list --workflow=build-boot.yml --branch=main --limit=1 --status=success --json databaseId --jq '.[0].databaseId' > latest_boot_run_id
73
+ gh run list --workflow=build-boot.yml --branch=create-sdcard --limit=1 --status=success --json databaseId --jq '.[0].databaseId' > latest_boot_run_id
68
74
BOOT_RUN_ID=$(cat latest_boot_run_id)
69
-
75
+
70
76
gh run download ${BOOT_RUN_ID} --name artifact-${BOOTLOADER} --dir temp_bootloader/
71
-
77
+
72
78
# Extract bootloader directly to output/images
73
79
cd temp_bootloader/
74
80
tar -xzf *.tar.gz --strip-components=1 -C ../output/images/
75
81
cd ../
76
82
rm -rf temp_bootloader/
77
-
83
+
78
84
echo "Bootloader files extracted to output/images:"
79
85
ls -la output/images/
80
86
env :
@@ -83,18 +89,18 @@ jobs:
83
89
- name : Download Infix artifacts
84
90
if : ${{ !inputs.use_latest_release }}
85
91
run : |
86
- # Download from latest Infix build workflow for main branch
87
- gh run list --workflow=build.yml --branch=main --limit=1 --status=success --json databaseId --jq '.[0].databaseId' > latest_infix_run_id
92
+ # Download from latest Kernelkit Trigger workflow for main branch
93
+ gh run list --workflow=164295764 --branch=main --limit=1 --status=success --json databaseId --jq '.[0].databaseId' > latest_infix_run_id
88
94
INFIX_RUN_ID=$(cat latest_infix_run_id)
89
-
95
+
90
96
gh run download ${INFIX_RUN_ID} --name artifact-${TARGET} --dir temp_infix/
91
-
97
+
92
98
# Extract Infix directly to output/images
93
99
cd temp_infix/
94
100
tar -xzf *.tar.gz --strip-components=1 -C ../output/images/
95
101
cd ../
96
102
rm -rf temp_infix/
97
-
103
+
98
104
echo "Infix files extracted to output/images:"
99
105
ls -la output/images/
100
106
env :
@@ -109,14 +115,14 @@ jobs:
109
115
tar -xzf *.tar.gz --strip-components=1 -C ../output/images/
110
116
cd ../
111
117
rm -rf temp_bootloader/
112
-
118
+
113
119
# Download latest Infix release
114
120
gh release download latest --pattern "*${TARGET}*" --dir temp_infix/
115
121
cd temp_infix/
116
122
tar -xzf *.tar.gz --strip-components=1 -C ../output/images/
117
123
cd ../
118
124
rm -rf temp_infix/
119
-
125
+
120
126
echo "All files extracted to output/images:"
121
127
ls -la output/images/
122
128
env :
@@ -135,10 +141,13 @@ jobs:
135
141
export BINARIES_DIR=$PWD/output/images
136
142
export BUILD_DIR=$PWD/build
137
143
export BR2_EXTERNAL_INFIX_PATH=$PWD
138
-
144
+ export RELEASE=""
145
+ export INFIX_ID="infix"
146
+
139
147
# Use the standardized mkimage.sh path for the selected board
140
- BOARD_SCRIPT="src/board/${{ inputs.board }}/mkimage.sh"
141
-
148
+ # BOARD_SCRIPT="src/board/${{ inputs.board }}/mkimage.sh"
149
+ BOARD_SCRIPT="src/board/raspberry-pi-4/mkimage.sh"
150
+
142
151
if [ -f "$BOARD_SCRIPT" ]; then
143
152
echo "Using board-specific image creation script: $BOARD_SCRIPT"
144
153
chmod +x "$BOARD_SCRIPT"
@@ -152,7 +161,7 @@ jobs:
152
161
run : |
153
162
echo "Contents of output/images after mkimage.sh:"
154
163
ls -lh output/images/
155
-
164
+
156
165
# Look for SD card image with pattern: *-sdcard.img
157
166
if ls output/images/*-sdcard.img 1> /dev/null 2>&1; then
158
167
echo "Found SD card image(s):"
@@ -201,15 +210,15 @@ jobs:
201
210
run : |
202
211
cat <<EOF >> $GITHUB_STEP_SUMMARY
203
212
# SD Card Image Build Complete! 🚀
204
-
213
+
205
214
**Board:** ${{ inputs.board }}
206
- **Target:** ${{ env.TARGET }}
215
+ **Target:** ${{ env.TARGET }}
207
216
**Bootloader:** ${{ env.BOOTLOADER }}
208
217
**Artifact Source:** ${{ inputs.use_latest_release && 'Latest Release' || 'Latest Workflow Run' }}
209
-
218
+
210
219
## Created Images
211
220
$(find output/images/ -name "*.img" -o -name "*.qcow2" -o -name "*.raw" | xargs ls -lh 2>/dev/null | sed 's/^/- /' || echo "- No images found")
212
-
221
+
213
222
## Download
214
223
The SD card image is available as a workflow artifact above.
215
- EOF
224
+ EOF
0 commit comments