diff --git a/.gitea/workflows/base-build.yml b/.gitea/workflows/base-build.yml index 7b9f89e..ce83f72 100644 --- a/.gitea/workflows/base-build.yml +++ b/.gitea/workflows/base-build.yml @@ -54,21 +54,25 @@ jobs: - name: Debug output folder run: | - echo "Archives present:" - ls -lh ./debian-*.tar.bz2 || true - ls -lh rootfs-*.tar.bz2 || true + echo "Archives present in output:" + find ./output -name '*.tar.bz2' -exec ls -lh {} \; - name: List output archives run: | - echo "[INFO] Looking for tarballs in output/..." - find output -name '*.tar.bz2' -exec ls -lh {} \; + echo "[INFO] Final archive list:" + find ./output -type f -name 'debian-*.tar.bz2' - # - name: Debug workspace contents - # run: | - # echo "Current directory:" - # pwd - # echo "Contents:" - # ls -R + - name: Validate that archives exist for each version + run: | + for version in $VERSIONS; do + path="output/$version/debian-$version.tar.bz2" + if [[ ! -f "$path" ]]; then + echo "[ERROR] Missing archive: $path" + exit 1 + else + echo "[OK] Found: $path" + fi + done push-archives-to-repo: needs: build-rootfs-archives @@ -88,23 +92,21 @@ jobs: - name: Copy new archives to upload-repo run: | - found=$(find output -name '*.tar.bz2') + found=$(find ./output -type f -name 'debian-*.tar.bz2') if [ -z "$found" ]; then - echo "[WARNING] No .tar.bz2 archive found!" + echo "[WARNING] No .tar.bz2 archive found in output/!" exit 1 fi for filepath in $found; do - filename=$(basename "$filepath") - version=$(echo "$filename" | sed -E 's/^debian-([a-z]+)\.tar\.bz2$/\1/') - mkdir -p upload-repo/"$version" - cp "$filepath" upload-repo/"$version"/ + version_dir=$(basename "$(dirname "$filepath")") + mkdir -p "upload-repo/$version_dir" + cp "$filepath" "upload-repo/$version_dir/" done - name: Calculate and store sha256sums in upload-repo run: | cd upload-repo - echo "[INFO] Calculating sha256sums..." rm -f sha256sums.txt for tarball in */debian-*.tar.bz2; do echo "[INFO] Processing: $tarball" @@ -252,7 +254,7 @@ jobs: size_human=$(human_size "$size_bytes") # Load SHA256 from file if available - SHA256=$(grep "/$version/rootfs-$version.tar.bz2" ../sha256sums.txt | awk '{print $1}') + SHA256=$(grep "$version/debian-$version.tar.bz2" ../sha256sums.txt | awk '{print $1}') if [[ -z "$SHA256" ]]; then SHA256="unknown" fi diff --git a/base-image-script/bootstrap-rootfs.sh b/base-image-script/bootstrap-rootfs.sh index 840caef..ed391c6 100644 --- a/base-image-script/bootstrap-rootfs.sh +++ b/base-image-script/bootstrap-rootfs.sh @@ -42,7 +42,7 @@ echo "[INFO] Rootfs size:" du -sh "$ROOTFS_DIR" echo "[INFO] Creating compressed base image..." -mkdir -p "/$OUTPUT_DIR/$DEBIAN_RELEASE" +mkdir -p "$OUTPUT_DIR/$DEBIAN_RELEASE" tar -cjf "$TARBALL" -C "$ROOTFS_DIR" . ls -lh "$TARBALL"