mirror of
https://github.com/Z3Prover/z3
synced 2026-02-14 04:41:48 +00:00
Merge pull request #8602 from Z3Prover/copilot/fix-nightly-build-job
Fix nightly workflow: remove unsupported --clobber flag and add artifact deduplication
This commit is contained in:
commit
b381de4f3f
1 changed files with 29 additions and 8 deletions
37
.github/workflows/nightly.yml
vendored
37
.github/workflows/nightly.yml
vendored
|
|
@ -706,15 +706,36 @@ 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
|
||||
|
||||
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' ' ')
|
||||
# Deduplicate files - keep only first occurrence of each basename
|
||||
# Use NUL-delimited input/output to handle spaces in filenames safely
|
||||
declare -A seen_basenames
|
||||
declare -a unique_files
|
||||
|
||||
while IFS= read -r -d $'\0' filepath || [ -n "$filepath" ]; do
|
||||
[ -z "$filepath" ] && continue
|
||||
basename="${filepath##*/}"
|
||||
|
||||
# Keep only first occurrence of each basename
|
||||
if [ -z "${seen_basenames[$basename]}" ]; then
|
||||
seen_basenames[$basename]=1
|
||||
unique_files+=("$filepath")
|
||||
fi
|
||||
done < release_files.txt
|
||||
|
||||
# Create release with properly quoted file arguments
|
||||
if [ ${#unique_files[@]} -gt 0 ]; then
|
||||
gh release create Nightly \
|
||||
--title "Nightly" \
|
||||
--notes "Automated nightly build from commit ${{ github.sha }}" \
|
||||
--prerelease \
|
||||
--target ${{ github.sha }} \
|
||||
"${unique_files[@]}"
|
||||
else
|
||||
echo "No files to release after deduplication"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
publish-test-pypi:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue