mirror of
https://github.com/Z3Prover/z3
synced 2026-02-14 12:51:48 +00:00
Fix nightly build workflow by removing --clobber and adding deduplication
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
2f374a75b4
commit
d1146a74c0
1 changed files with 37 additions and 3 deletions
40
.github/workflows/nightly.yml
vendored
40
.github/workflows/nightly.yml
vendored
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue