1414 description : ' Use latest release artifacts instead of workflow artifacts'
1515 type : boolean
1616 default : false
17-
17+ pull_request :
18+ types : [labeled]
1819jobs :
1920 create-image :
2021 name : Create SD Card Image for ${{ inputs.board }}
2122 runs-on : ubuntu-latest
23+ # runs-on: [ self-hosted, latest ]
2224 steps :
2325 - name : Checkout repository
2426 uses : actions/checkout@v4
2527 with :
2628 clean : true
27- fetch-depth : 1
29+ fetch-depth : 0
2830 submodules : recursive
2931
3032 - name : Install dependencies
3840 qemu-utils \
3941 dosfstools \
4042 e2fsprogs \
43+ genext2fs \
44+ mtools \
4145 jq
4246
4347 - name : Prepare build environment
4852
4953 - name : Set bootloader and target based on board
5054 run : |
51- case "${{ inputs.board }}" in
55+ #case "${{ inputs.board }}" in
56+ case "raspberry-pi-4" in
5257 raspberry-pi-4)
5358 echo "BOOTLOADER=rpi4_boot" >> $GITHUB_ENV
5459 echo "TARGET=aarch64" >> $GITHUB_ENV
@@ -64,17 +69,18 @@ jobs:
6469 if : ${{ !inputs.use_latest_release }}
6570 run : |
6671 # 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
6874 BOOT_RUN_ID=$(cat latest_boot_run_id)
69-
75+
7076 gh run download ${BOOT_RUN_ID} --name artifact-${BOOTLOADER} --dir temp_bootloader/
71-
77+
7278 # Extract bootloader directly to output/images
7379 cd temp_bootloader/
7480 tar -xzf *.tar.gz --strip-components=1 -C ../output/images/
7581 cd ../
7682 rm -rf temp_bootloader/
77-
83+
7884 echo "Bootloader files extracted to output/images:"
7985 ls -la output/images/
8086 env :
@@ -83,18 +89,18 @@ jobs:
8389 - name : Download Infix artifacts
8490 if : ${{ !inputs.use_latest_release }}
8591 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
8894 INFIX_RUN_ID=$(cat latest_infix_run_id)
89-
95+
9096 gh run download ${INFIX_RUN_ID} --name artifact-${TARGET} --dir temp_infix/
91-
97+
9298 # Extract Infix directly to output/images
9399 cd temp_infix/
94100 tar -xzf *.tar.gz --strip-components=1 -C ../output/images/
95101 cd ../
96102 rm -rf temp_infix/
97-
103+
98104 echo "Infix files extracted to output/images:"
99105 ls -la output/images/
100106 env :
@@ -109,14 +115,14 @@ jobs:
109115 tar -xzf *.tar.gz --strip-components=1 -C ../output/images/
110116 cd ../
111117 rm -rf temp_bootloader/
112-
118+
113119 # Download latest Infix release
114120 gh release download latest --pattern "*${TARGET}*" --dir temp_infix/
115121 cd temp_infix/
116122 tar -xzf *.tar.gz --strip-components=1 -C ../output/images/
117123 cd ../
118124 rm -rf temp_infix/
119-
125+
120126 echo "All files extracted to output/images:"
121127 ls -la output/images/
122128 env :
@@ -135,10 +141,13 @@ jobs:
135141 export BINARIES_DIR=$PWD/output/images
136142 export BUILD_DIR=$PWD/build
137143 export BR2_EXTERNAL_INFIX_PATH=$PWD
138-
144+ export RELEASE=""
145+ export INFIX_ID="infix"
146+
139147 # 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+
142151 if [ -f "$BOARD_SCRIPT" ]; then
143152 echo "Using board-specific image creation script: $BOARD_SCRIPT"
144153 chmod +x "$BOARD_SCRIPT"
@@ -152,7 +161,7 @@ jobs:
152161 run : |
153162 echo "Contents of output/images after mkimage.sh:"
154163 ls -lh output/images/
155-
164+
156165 # Look for SD card image with pattern: *-sdcard.img
157166 if ls output/images/*-sdcard.img 1> /dev/null 2>&1; then
158167 echo "Found SD card image(s):"
@@ -201,15 +210,15 @@ jobs:
201210 run : |
202211 cat <<EOF >> $GITHUB_STEP_SUMMARY
203212 # SD Card Image Build Complete! 🚀
204-
213+
205214 **Board:** ${{ inputs.board }}
206- **Target:** ${{ env.TARGET }}
215+ **Target:** ${{ env.TARGET }}
207216 **Bootloader:** ${{ env.BOOTLOADER }}
208217 **Artifact Source:** ${{ inputs.use_latest_release && 'Latest Release' || 'Latest Workflow Run' }}
209-
218+
210219 ## Created Images
211220 $(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+
213222 ## Download
214223 The SD card image is available as a workflow artifact above.
215- EOF
224+ EOF
0 commit comments