From d1146a74c053b20243fc8ea4f68bd61714d17092 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 17:39:24 +0000 Subject: [PATCH] Fix nightly build workflow by removing --clobber and adding deduplication Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- .github/workflows/nightly.yml | 40 ++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 43a9adc4d..1ff12e741 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -706,15 +706,49 @@ jobs: GH_TOKEN: ${{ github.token }} run: | ls - find tmp -type f \( -name "*.zip" -o -name "*.whl" -o -name "*.tar.gz" -o -name "*.nupkg" -o -name "*.snupkg" \) > release_files.txt + find tmp -type f \( -name "*.zip" -o -name "*.whl" -o -name "*.tar.gz" -o -name "*.nupkg" -o -name "*.snupkg" \) -print0 > release_files.txt + + # Deduplicate files - keep only first occurrence of each basename + # Use NUL-delimited input/output to handle spaces in filenames safely + python3 << 'DEDUP_SCRIPT' + import sys + import os + + seen_basenames = set() + unique_files = [] + + # Read NUL-delimited input + with open("release_files.txt", "rb") as f: + content = f.read() + files = content.decode("utf-8").split("\0") if content else [] + + for filepath in files: + filepath = filepath.strip() + if not filepath: + continue + + basename = os.path.basename(filepath) + + # Keep only first occurrence of each basename + if basename not in seen_basenames: + seen_basenames.add(basename) + unique_files.append(filepath) + + # Write NUL-delimited output + with open("release_files_dedup.txt", "wb") as f: + f.write("\0".join(unique_files).encode("utf-8")) + DEDUP_SCRIPT + + # Convert NUL-delimited list to space-separated for gh command + # Use printf to safely handle filenames with spaces + RELEASE_FILES=$(cat release_files_dedup.txt | tr '\0' '\n' | grep -v '^$') gh release create Nightly \ --title "Nightly" \ --notes "Automated nightly build from commit ${{ github.sha }}" \ --prerelease \ --target ${{ github.sha }} \ - --clobber \ - $(cat release_files.txt | tr '\n' ' ') + $RELEASE_FILES publish-test-pypi: