From 09e2a40bc38d953b21b08c138773c098d149e9d0 Mon Sep 17 00:00:00 2001 From: fithwum Date: Sat, 5 Jul 2025 08:13:17 -0700 Subject: [PATCH] test --- .gitea/workflows/base-build.yml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/base-build.yml b/.gitea/workflows/base-build.yml index 4165a6a..fb74571 100644 --- a/.gitea/workflows/base-build.yml +++ b/.gitea/workflows/base-build.yml @@ -47,28 +47,33 @@ jobs: git clone "$REPO_URL" upload-repo + # Clean old archives mkdir -p upload-repo/${{ matrix.version }} find upload-repo/${{ matrix.version }} -name '*.tar.bz2' -type f -delete - # Clean old tarballs - for version_dir in bookworm bullseye buster docker-build; do - find upload-repo/"$version_dir" -name '*.tar.bz2' -type f -delete || true + # Find and copy archives + found=$(find . -name '*.tar.bz2') + if [ -n "$found" ]; then + for filepath in $found; do + version_dir=$(dirname "$filepath") + mkdir -p upload-repo/"$version_dir" + cp "$filepath" upload-repo/"$version_dir"/ done - # Find all tarballs recursively in the workspace - found=$(find . -name '*.tar.bz2') + # Debug list to verify files copied + ls -lR upload-repo - if [ -n "$found" ]; then - for filepath in $found; do - version_dir=$(dirname "$filepath") - mkdir -p "upload-repo/$version_dir" - cp "$filepath" "upload-repo/$version_dir/" - done + cd upload-repo - cd upload-repo - git add **/*.tar.bz2 + git add **/*.tar.bz2 + + if git diff --cached --quiet; then + echo "[INFO] No changes to commit." + else git commit -m "Update base images on $(date -u +'%Y-%m-%dT%H:%M:%SZ')" git push + fi + else echo "[WARNING] No .tar.bz2 archive found in workspace!" exit 1