Skip to content

Commit 05ca72a

Browse files
committed
Update publish.yml
1 parent 04adfcf commit 05ca72a

1 file changed

Lines changed: 27 additions & 5 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,37 @@ jobs:
6565
run: |
6666
# List all distribution files that will be published
6767
echo "Distribution files to be published:"
68-
ls -la dist/ || echo "No dist/ directory found"
69-
# Verify only python-package-folder files are present
70-
if ls dist/*.whl dist/*.tar.gz 2>/dev/null | grep -v "python-package-folder"; then
71-
echo "Error: Found distribution files for packages other than python-package-folder"
68+
ls -la dist/ || (echo "No dist/ directory found" && exit 1)
69+
70+
# Check for unexpected files (exclude .gitignore and expected package files)
71+
UNEXPECTED_FILES=0
72+
for file in dist/*.whl dist/*.tar.gz; do
73+
if [ -f "$file" ]; then
74+
filename=$(basename "$file")
75+
# Check if file starts with python_package_folder (package directory name)
76+
if [[ ! "$filename" =~ ^python_package_folder- ]]; then
77+
echo "Error: Found unexpected distribution file: $filename"
78+
UNEXPECTED_FILES=$((UNEXPECTED_FILES + 1))
79+
fi
80+
fi
81+
done
82+
83+
if [ $UNEXPECTED_FILES -gt 0 ]; then
84+
echo "Error: Found $UNEXPECTED_FILES unexpected distribution file(s)"
7285
echo "Files in dist/:"
7386
ls -la dist/
7487
exit 1
7588
fi
76-
echo "✓ Only python-package-folder distribution files found"
89+
90+
# Verify at least one expected file exists
91+
if ! ls dist/python_package_folder-*.whl dist/python_package_folder-*.tar.gz 2>/dev/null | grep -q .; then
92+
echo "Error: No python_package_folder distribution files found"
93+
echo "Files in dist/:"
94+
ls -la dist/
95+
exit 1
96+
fi
97+
98+
echo "✓ Only python_package_folder distribution files found"
7799
78100
- name: Publish to PyPI
79101
run: uv publish --trusted-publishing always

0 commit comments

Comments
 (0)