Skip to content

Commit b381de4

Browse files
Merge pull request #8602 from Z3Prover/copilot/fix-nightly-build-job
Fix nightly workflow: remove unsupported --clobber flag and add artifact deduplication
2 parents 5497de0 + 97bdef7 commit b381de4

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

.github/workflows/nightly.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -706,15 +706,36 @@ jobs:
706706
GH_TOKEN: ${{ github.token }}
707707
run: |
708708
ls
709-
find tmp -type f \( -name "*.zip" -o -name "*.whl" -o -name "*.tar.gz" -o -name "*.nupkg" -o -name "*.snupkg" \) > release_files.txt
709+
find tmp -type f \( -name "*.zip" -o -name "*.whl" -o -name "*.tar.gz" -o -name "*.nupkg" -o -name "*.snupkg" \) -print0 > release_files.txt
710710
711-
gh release create Nightly \
712-
--title "Nightly" \
713-
--notes "Automated nightly build from commit ${{ github.sha }}" \
714-
--prerelease \
715-
--target ${{ github.sha }} \
716-
--clobber \
717-
$(cat release_files.txt | tr '\n' ' ')
711+
# Deduplicate files - keep only first occurrence of each basename
712+
# Use NUL-delimited input/output to handle spaces in filenames safely
713+
declare -A seen_basenames
714+
declare -a unique_files
715+
716+
while IFS= read -r -d $'\0' filepath || [ -n "$filepath" ]; do
717+
[ -z "$filepath" ] && continue
718+
basename="${filepath##*/}"
719+
720+
# Keep only first occurrence of each basename
721+
if [ -z "${seen_basenames[$basename]}" ]; then
722+
seen_basenames[$basename]=1
723+
unique_files+=("$filepath")
724+
fi
725+
done < release_files.txt
726+
727+
# Create release with properly quoted file arguments
728+
if [ ${#unique_files[@]} -gt 0 ]; then
729+
gh release create Nightly \
730+
--title "Nightly" \
731+
--notes "Automated nightly build from commit ${{ github.sha }}" \
732+
--prerelease \
733+
--target ${{ github.sha }} \
734+
"${unique_files[@]}"
735+
else
736+
echo "No files to release after deduplication"
737+
exit 1
738+
fi
718739
719740
720741
publish-test-pypi:

0 commit comments

Comments
 (0)