Fix artifact collection: workspace-relative dist, canonical image names, checksums
Build RPi image / build (push) Successful in 11s

This commit is contained in:
druppy committed 2026-10-24 19:14:09 +02:00
1 parent 5396dd1d7e
commit 571c8ad70c
1 file changed
+28 -11
+28 -11
View File
@@ -37,7 +37,7 @@ jobs:
echo "=== runner environment ===" echo "=== runner environment ==="
uname -a uname -a
[ -r /etc/os-release ] && . /etc/os-release && echo "$PRETTY_NAME" [ -r /etc/os-release ] && . /etc/os-release && echo "$PRETTY_NAME"
echo "HOME=$HOME workspace=$GITEA_WORKSPACE nproc=$(nproc)" echo "HOME=$HOME workspace=$(pwd) nproc=$(nproc)"
df -h "$HOME" | tail -1 df -h "$HOME" | tail -1
free -h 2>/dev/null | sed -n 2p || true free -h 2>/dev/null | sed -n 2p || true
command -v docker >/dev/null && docker info --format 'docker: {{.ServerVersion}}' 2>/dev/null || echo "no docker daemon" command -v docker >/dev/null && docker info --format 'docker: {{.ServerVersion}}' 2>/dev/null || echo "no docker daemon"
@@ -91,6 +91,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
export YOCTO_HOME="${YOCTO_HOME:-$HOME/yocto-build}" export YOCTO_HOME="${YOCTO_HOME:-$HOME/yocto-build}"
WS="$(pwd)" # workspace; upload-artifact's path is relative to it
cd "$YOCTO_HOME/yocto_rpi" cd "$YOCTO_HOME/yocto_rpi"
IMG_DIR="$(find build -type d -path '*/tmp/deploy/images/raspberrypi4-64' | head -1)" IMG_DIR="$(find build -type d -path '*/tmp/deploy/images/raspberrypi4-64' | head -1)"
if [ -z "$IMG_DIR" ]; then if [ -z "$IMG_DIR" ]; then
@@ -98,16 +99,32 @@ jobs:
exit 1 exit 1
fi fi
echo "images in: $IMG_DIR" echo "images in: $IMG_DIR"
ls -lh "$IMG_DIR" mkdir -p "$WS/dist"
mkdir -p "$GITEA_WORKSPACE/dist" shopt -s nullglob
# only the image artefacts, not the million symlinks/cache dirs # only the timestamped canonical names - the short "...rootfs.wic.bz2"
find "$IMG_DIR" -maxdepth 1 -type f \( -name '*.wic*' -o -name '*.ext4*' -o -name '*.rootfs*' -o -name '*.tar.bz2' -o -name '*.dtb' -o -name 'Image*' -o -name 'modules*' \) -exec cp -av {} "$GITEA_WORKSPACE/dist/" \; # entries are hardlinks to the same inode (would double the upload)
{ FILES=("$IMG_DIR"/rpilinux-image-*.rootfs-[0-9]*.wic.bz2 "$IMG_DIR"/rpilinux-image-*.rootfs-[0-9]*.wic.bmap)
echo "## RPi4 image built" if [ ${#FILES[@]} -eq 0 ]; then
echo echo "::error::no flashable .wic image found in $IMG_DIR"
echo "- commit: ${GITEA_SHA}" exit 1
echo "- build tree on runner host: \`$YOCTO_HOME/yocto_rpi/$IMG_DIR\`" fi
} >> "$GITEA_STEP_SUMMARY" cp -v "${FILES[@]}" "$WS/dist/"
( cd "$WS/dist" && sha256sum * > SHA256SUMS )
ls -lh "$WS/dist"
SUMMARY="${GITEA_STEP_SUMMARY:-${GITHUB_STEP_SUMMARY:-}}"
if [ -n "$SUMMARY" ]; then
{
echo "## RPi4 image built"
echo
echo "| file | sha256 |"
echo "|---|---|"
( cd "$WS/dist" && while read -r sum f; do echo "| \`$f\` | \`${sum:0:16}\` |"; done < SHA256SUMS )
echo
echo "Flash: \`bzcat <file> | sudo dd of=/dev/sdX bs=4M status=progress\`"
echo
echo "Build tree (incremental) on runner host: \`$YOCTO_HOME/yocto_rpi\`"
} >> "$SUMMARY"
fi
- name: Upload images - name: Upload images
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4