diff --git a/.gitea/workflows/base-build.yml b/.gitea/workflows/base-build.yml index 4bf1b95..4165a6a 100644 --- a/.gitea/workflows/base-build.yml +++ b/.gitea/workflows/base-build.yml @@ -50,15 +50,19 @@ jobs: 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 + done + # Find all tarballs recursively in the workspace found=$(find . -name '*.tar.bz2') if [ -n "$found" ]; then - # For each tarball found, get the version folder (parent dir) and copy to matching upload-repo folder for filepath in $found; do version_dir=$(dirname "$filepath") - mkdir -p upload-repo/"$version_dir" - cp "$filepath" upload-repo/"$version_dir"/ + mkdir -p "upload-repo/$version_dir" + cp "$filepath" "upload-repo/$version_dir/" done cd upload-repo