mirror of
https://github.com/Z3Prover/z3
synced 2026-04-29 23:33:38 +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
aa95c98664
commit
6bc44183bc
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 }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
ls
|
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 \
|
gh release create Nightly \
|
||||||
--title "Nightly" \
|
--title "Nightly" \
|
||||||
--notes "Automated nightly build from commit ${{ github.sha }}" \
|
--notes "Automated nightly build from commit ${{ github.sha }}" \
|
||||||
--prerelease \
|
--prerelease \
|
||||||
--target ${{ github.sha }} \
|
--target ${{ github.sha }} \
|
||||||
--clobber \
|
$RELEASE_FILES
|
||||||
$(cat release_files.txt | tr '\n' ' ')
|
|
||||||
|
|
||||||
|
|
||||||
publish-test-pypi:
|
publish-test-pypi:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue