@@ -652,6 +652,10 @@ jobs:
652652 echo $PWD/../../../artifacts/win-arm64-bin/* | xargs printf 'PACKAGE_FROM_RELEASE=%s\n' | xargs -I '{}' env '{}' python3 setup.py bdist_wheel
653653 echo $PWD/../../../artifacts/osx-x64-bin/* | xargs printf 'PACKAGE_FROM_RELEASE=%s\n' | xargs -I '{}' env '{}' python3 setup.py bdist_wheel
654654 echo $PWD/../../../artifacts/osx-arm64-bin/* | xargs printf 'PACKAGE_FROM_RELEASE=%s\n' | xargs -I '{}' env '{}' python3 setup.py bdist_wheel
655+
656+ - name : Copy Linux Python packages
657+ run : |
658+ cp artifacts/*.whl src/api/python/dist/.
655659
656660 - name : Upload artifact
657661 uses : actions/upload-artifact@v6
@@ -699,17 +703,40 @@ jobs:
699703 env :
700704 GH_TOKEN : ${{ github.token }}
701705 run : |
702- find tmp -type f \( -name "*.zip" -o -name "*.whl" -o -name "*.tar.gz" -o -name "*.nupkg" -o -name "*.snupkg" \) > release_files.txt
703706
704- less release_files.txt
707+ ls
708+ find tmp -type f \( -name "*.zip" -o -name "*.whl" -o -name "*.tar.gz" -o -name "*.nupkg" -o -name "*.snupkg" \) -print0 > release_files.txt
709+
710+ # Deduplicate files - keep only first occurrence of each basename
711+ # Use NUL-delimited input/output to handle spaces in filenames safely
712+ declare -A seen_basenames
713+ declare -a unique_files
714+
715+ while IFS= read -r -d $'\0' filepath || [ -n "$filepath" ]; do
716+ [ -z "$filepath" ] && continue
717+ basename="${filepath##*/}"
718+
719+ # Keep only first occurrence of each basename
720+ if [ -z "${seen_basenames[$basename]}" ]; then
721+ seen_basenames[$basename]=1
722+ unique_files+=("$filepath")
723+ fi
724+ done < release_files.txt
725+
726+ # Create release with properly quoted file arguments
727+ if [ ${#unique_files[@]} -gt 0 ]; then
728+ gh release create z3-${{ env.RELEASE_VERSION }} \
729+ --title "z3-${{ env.RELEASE_VERSION }}" \
730+ --notes "${{ env.RELEASE_VERSION }} release" \
731+ --draft \
732+ --prerelease \
733+ --target ${{ github.sha }} \
734+ "${unique_files[@]}"
735+ else
736+ echo "No files to release after deduplication"
737+ exit 1
738+ fi
705739
706- gh release create z3-${{ env.RELEASE_VERSION }} \
707- --title "z3-${{ env.RELEASE_VERSION }}" \
708- --notes "${{ env.RELEASE_VERSION }} release" \
709- --draft \
710- --prerelease \
711- --target ${{ github.sha }} \
712- $(cat release_files.txt | tr '\n' ' ')
713740
714741 publish-nuget :
715742 name : " Publish to NuGet.org"
0 commit comments